function
stringlengths
11
56k
repo_name
stringlengths
5
60
features
list
def test_create_token_response(self): bearer = BearerToken(self.mock_validator) headers, body, status_code = self.auth.create_token_response( self.request, bearer) token = json.loads(body) self.assertEqual(self.mock_validator.save_token.call_count, 1) self.assertI...
idan/oauthlib
[ 2555, 477, 2555, 82, 1321744131 ]
def test_custom_auth_validators_unsupported(self): authval1, authval2 = mock.Mock(), mock.Mock() expected = ('ResourceOwnerPasswordCredentialsGrant does not ' 'support authorization validators. Use token ' 'validators instead.') with self.assertR...
idan/oauthlib
[ 2555, 477, 2555, 82, 1321744131 ]
def test_error_response(self): pass
idan/oauthlib
[ 2555, 477, 2555, 82, 1321744131 ]
def test_invalid_request_missing_params(self): del self.request.grant_type self.assertRaises(errors.InvalidRequestError, self.auth.validate_token_request, self.request)
idan/oauthlib
[ 2555, 477, 2555, 82, 1321744131 ]
def test_invalid_grant_type(self): self.request.grant_type = 'foo' self.assertRaises(errors.UnsupportedGrantTypeError, self.auth.validate_token_request, self.request)
idan/oauthlib
[ 2555, 477, 2555, 82, 1321744131 ]
def test_client_id_missing(self): del self.request.client.client_id self.assertRaises(NotImplementedError, self.auth.validate_token_request, self.request)
idan/oauthlib
[ 2555, 477, 2555, 82, 1321744131 ]
def __init__(self, app: ASGIApp, dispatch: DispatchFunction = None) -> None: self.app = app self.dispatch_func = self.dispatch if dispatch is None else dispatch
encode/starlette
[ 7965, 724, 7965, 41, 1529932581 ]
def __init__(self, **kwargs): """ Initializes a CTranslationMap instance Notes: You can specify all parameters while calling this methods. A special argument named `data` will enable you to load the object from a Python dictionary Example...
nuagenetworks/vspk-python
[ 19, 18, 19, 7, 1457133058 ]
def mapping_type(self): """ Get mapping_type value. Notes: NAT for 1:1 mapping or PAT for *:1 mappings.
nuagenetworks/vspk-python
[ 19, 18, 19, 7, 1457133058 ]
def mapping_type(self, value): """ Set mapping_type value. Notes: NAT for 1:1 mapping or PAT for *:1 mappings.
nuagenetworks/vspk-python
[ 19, 18, 19, 7, 1457133058 ]
def last_updated_by(self): """ Get last_updated_by value. Notes: ID of the user who last updated the object.
nuagenetworks/vspk-python
[ 19, 18, 19, 7, 1457133058 ]
def last_updated_by(self, value): """ Set last_updated_by value. Notes: ID of the user who last updated the object.
nuagenetworks/vspk-python
[ 19, 18, 19, 7, 1457133058 ]
def entity_scope(self): """ Get entity_scope value. Notes: Specify if scope of entity is Data center or Enterprise level
nuagenetworks/vspk-python
[ 19, 18, 19, 7, 1457133058 ]
def entity_scope(self, value): """ Set entity_scope value. Notes: Specify if scope of entity is Data center or Enterprise level
nuagenetworks/vspk-python
[ 19, 18, 19, 7, 1457133058 ]
def associated_domain_id(self): """ Get associated_domain_id value. Notes: Domain associated to this address mapping.
nuagenetworks/vspk-python
[ 19, 18, 19, 7, 1457133058 ]
def associated_domain_id(self, value): """ Set associated_domain_id value. Notes: Domain associated to this address mapping.
nuagenetworks/vspk-python
[ 19, 18, 19, 7, 1457133058 ]
def customer_alias_ip(self): """ Get customer_alias_ip value. Notes: Customer public IP in the provider domain.
nuagenetworks/vspk-python
[ 19, 18, 19, 7, 1457133058 ]
def customer_alias_ip(self, value): """ Set customer_alias_ip value. Notes: Customer public IP in the provider domain.
nuagenetworks/vspk-python
[ 19, 18, 19, 7, 1457133058 ]
def customer_ip(self): """ Get customer_ip value. Notes: Customer private IP in the customer domain.
nuagenetworks/vspk-python
[ 19, 18, 19, 7, 1457133058 ]
def customer_ip(self, value): """ Set customer_ip value. Notes: Customer private IP in the customer domain.
nuagenetworks/vspk-python
[ 19, 18, 19, 7, 1457133058 ]
def external_id(self): """ Get external_id value. Notes: External object ID. Used for integration with third party systems
nuagenetworks/vspk-python
[ 19, 18, 19, 7, 1457133058 ]
def external_id(self, value): """ Set external_id value. Notes: External object ID. Used for integration with third party systems
nuagenetworks/vspk-python
[ 19, 18, 19, 7, 1457133058 ]
def add_overlaplcwp(self, parameters, timeslots=None, matrixsize=None, blockid=0, key=("ov", "ovkin", "ovpot")): r"""Add storage for various overlap matrices. We can store one matrix type per key. ========= ====== Key name Matrix ========= ====== ``ov`` :math:`\langle\Upsilon | \Upsilon\ran...
WaveBlocks/WaveBlocksND
[ 6, 8, 6, 34, 1332703340 ]
def has_overlaplcwp(self, blockid=0, key=("ov", "ovkin", "ovpot")): r"""Ask if the specified data block has the desired data tensor. :param blockid: The ID of the data block to operate on. :param key: Specify which overlap matrices to save. All are independent. :type key: Tuple of valid identifier stri...
WaveBlocks/WaveBlocksND
[ 6, 8, 6, 34, 1332703340 ]
def load_overlaplcwp_timegrid(self, blockid=0, key=("ov", "ovkin", "ovpot")): r"""Load the timegrid corresponding to the overlap matrices specified. :param blockid: The ID of the data block to operate on. :param key: Specify which overlap matrices to load. All are independent. :type key: Tuple of valid...
WaveBlocks/WaveBlocksND
[ 6, 8, 6, 34, 1332703340 ]
def __init__(self): from tardis.tardis_portal.models import Dataset_File for f in settings.POST_SAVE_FILTERS: cls = f[0] args = [] kw = {} if len(f) == 2: args = f[1] if len(f) == 3: kw = f[2] hook...
aaryani/CoreTardis
[ 3, 1, 3, 1, 1310021778 ]
def normalize_spectrum(wave, flux, norm_range, dwave, p=(1E-6, 1E-6), q=0.5, ivar=None, eps=1e-10, rsv_frac=1.): """ A double smooth normalization of a spectrum Converted from Chao Liu's normSpectrum.m Updated by Bo Zhang Parameters ---------- wave...
hypergravity/hrs
[ 5, 1, 5, 2, 1479823121 ]
def get_stable_pixels(pixel_disp, wave_arm=100, frac=0.20): """ Parameters ---------- pixel_disp: np.ndarray dispersion array wave_arm: int the arm length in terms of pixels frac: float the reserved fraction, between 0.00 and 1.00 Returns ------- ind_stable ...
hypergravity/hrs
[ 5, 1, 5, 2, 1479823121 ]
def normalize_spectra(wave_flux_tuple_list, norm_range, dwave, p=(1E-6, 1E-6), q=50, n_jobs=1, verbose=False): """ normalize multiple spectra using the same configuration Parameters ---------- wave_flux_tuple_list: list[n_obs] a list of (wave, flux) tuple norm_range: t...
hypergravity/hrs
[ 5, 1, 5, 2, 1479823121 ]
def setUp(self): (self.community, self.members, self.chairmens) = create_sample_community()
hasadna/OpenCommunity
[ 8, 16, 8, 18, 1372881176 ]
def test_send_invitation(self): i = Invitation.objects.create(community=self.community, created_by=self.members[0], email="xxx@xyz.com") i.send(self.members[0]) self.assertEqual(len(mail.outbox), 1) self.assertI...
hasadna/OpenCommunity
[ 8, 16, 8, 18, 1372881176 ]
def setUp(self): (self.community, self.members, self.chairmen) = create_sample_community()
hasadna/OpenCommunity
[ 8, 16, 8, 18, 1372881176 ]
def post_invite(self, data=None): if not data: data = {"email": "sample@email.com", "default_group_name": DefaultGroups.MEMBER, "message": "the message"} return self.client.post(reverse("members" , kwargs={"community_id": self.community.id}...
hasadna/OpenCommunity
[ 8, 16, 8, 18, 1372881176 ]
def test_view(self): self.login_chairmen() response = self.post_invite({"email": "sample@email.com", "default_group_name": DefaultGroups.MEMBER, "message": "the message"}) self.assertEqual(Invitation.objects.all().count(),...
hasadna/OpenCommunity
[ 8, 16, 8, 18, 1372881176 ]
def test_bad_email(self): self.login_chairmen() response = self.post_invite({"email": "not a real email", "default_group_name": DefaultGroups.MEMBER, "message": "the message"}) self.assertEqual(response.status_code, 400) ...
hasadna/OpenCommunity
[ 8, 16, 8, 18, 1372881176 ]
def calc_auc(predictions): y_true =[] y_score=[] for line in predictions: values= line.split(" ") y_true.append(float(values[1])) y_score.append(float(values[0])) auc = sklearn.metrics.roc_auc_score(y_true,y_score) return auc
gnina/scripts
[ 17, 80, 17, 1, 1456588807 ]
def dispatch(self, request, *args, **kwargs): requestuser_devilryrole = request.cradmin_instance.get_devilryrole_for_requestuser() if requestuser_devilryrole != PermissionGroup.GROUPTYPE_DEPARTMENTADMIN: raise Http404() return super(AbstractTypeInUsersView, self).dispatch(request=req...
devilry/devilry-django
[ 48, 23, 48, 82, 1264339874 ]
def get_backlink_label(self): raise NotImplementedError()
devilry/devilry-django
[ 48, 23, 48, 82, 1264339874 ]
def split_users_blob(cls, users_blob): """ Split the given string of users by ``,`` and whitespace. Returns a set. """ users_blob_split = cls.users_blob_split_pattern.split(users_blob) if len(users_blob_split) == 0: return [] if users_blob_split[0] ==...
devilry/devilry-django
[ 48, 23, 48, 82, 1264339874 ]
def __get_users_blob_placeholder(self): if settings.CRADMIN_LEGACY_USE_EMAIL_AUTH_BACKEND: return gettext_lazy('jane@example.com\njohn@example.com') else: return gettext_lazy('jane\njohn')
devilry/devilry-django
[ 48, 23, 48, 82, 1264339874 ]
def __validate_users_blob_emails(self, emails): invalid_emails = [] for email in emails: try: validate_email(email) except ValidationError: invalid_emails.append(email) if invalid_emai...
devilry/devilry-django
[ 48, 23, 48, 82, 1264339874 ]
def clean(self): cleaned_data = super(UserImportForm, self).clean() users_blob = cleaned_data.get('users_blob', None) if users_blob: users = AbstractTypeInUsersView.split_users_blob(users_blob) if settings.CRADMIN_LEGACY_USE_EMAIL_A...
devilry/devilry-django
[ 48, 23, 48, 82, 1264339874 ]
def get_field_layout(self): return [ layout.Div( layout.Field('users_blob', placeholder=self.__get_users_blob_placeholder()), css_class='cradmin-globalfields cradmin-legacy-formfield-label-sr-only') ]
devilry/devilry-django
[ 48, 23, 48, 82, 1264339874 ]
def get_success_url(self): return self.request.cradmin_app.reverse_appindexurl()
devilry/devilry-django
[ 48, 23, 48, 82, 1264339874 ]
def import_users_from_usernames(self, usernames): raise NotImplementedError()
devilry/devilry-django
[ 48, 23, 48, 82, 1264339874 ]
def get_keywords(): """Get the keywords needed to look up the version information.""" # these strings will be replaced by git during git-archive. # setup.py/versioneer.py will grep for the variable names, so they must # each be defined on a line of their own. _version.py will just call # get_keyword...
yt-project/unyt
[ 308, 44, 308, 33, 1522273616 ]
def get_config(): """Create, populate and return the VersioneerConfig() object.""" # these strings are filled in when 'setup.py versioneer' creates # _version.py cfg = VersioneerConfig() cfg.VCS = "git" cfg.style = "pep440" cfg.tag_prefix = "" cfg.parentdir_prefix = "unyt-" cfg.versi...
yt-project/unyt
[ 308, 44, 308, 33, 1522273616 ]
def register_vcs_handler(vcs, method): # decorator """Decorator to mark a method as the handler for a particular VCS.""" def decorate(f): """Store f in HANDLERS[vcs][method].""" if vcs not in HANDLERS: HANDLERS[vcs] = {} HANDLERS[vcs][method] = f return f return ...
yt-project/unyt
[ 308, 44, 308, 33, 1522273616 ]
def versions_from_parentdir(parentdir_prefix, root, verbose): """Try to determine the version from the parent directory name. Source tarballs conventionally unpack into a directory that includes both the project name and a version string. We will also support searching up two directory levels for an ap...
yt-project/unyt
[ 308, 44, 308, 33, 1522273616 ]
def git_get_keywords(versionfile_abs): """Extract version information from the given file.""" # the code embedded in _version.py can just fetch the value of these # keywords. When used from setup.py, we don't want to import _version.py, # so we do it with a regexp instead. This function is not used from...
yt-project/unyt
[ 308, 44, 308, 33, 1522273616 ]
def git_versions_from_keywords(keywords, tag_prefix, verbose): """Get version information from git keywords.""" if not keywords: raise NotThisMethod("no keywords at all, weird") date = keywords.get("date") if date is not None: # git-2.2.0 added "%cI", which expands to an ISO-8601 -compli...
yt-project/unyt
[ 308, 44, 308, 33, 1522273616 ]
def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): """Get version from 'git describe' in the root of the source tree. This only gets called if the git-archive 'subst' keywords were *not* expanded, and _version.py hasn't already been rewritten with a short version string, meani...
yt-project/unyt
[ 308, 44, 308, 33, 1522273616 ]
def render_pep440(pieces): """Build up version string, with post-release "local version identifier". Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty Exceptions: 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHE...
yt-project/unyt
[ 308, 44, 308, 33, 1522273616 ]
def render_pep440_post(pieces): """TAG[.postDISTANCE[.dev0]+gHEX] . The ".dev0" means dirty. Note that .dev0 sorts backwards (a dirty tree will appear "older" than the corresponding clean one), but you shouldn't be releasing software with -dirty anyways. Exceptions: 1: no tags. 0.postDISTANCE[...
yt-project/unyt
[ 308, 44, 308, 33, 1522273616 ]
def render_git_describe(pieces): """TAG[-DISTANCE-gHEX][-dirty]. Like 'git describe --tags --dirty --always'. Exceptions: 1: no tags. HEX[-dirty] (note: no 'g' prefix) """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"]: rendered +=...
yt-project/unyt
[ 308, 44, 308, 33, 1522273616 ]
def render(pieces, style): """Render the given version pieces into the requested style.""" if pieces["error"]: return {"version": "unknown", "full-revisionid": pieces.get("long"), "dirty": None, "error": pieces["error"], "date": None} ...
yt-project/unyt
[ 308, 44, 308, 33, 1522273616 ]
def _GetProcessStartTime(pid): p = psutil.Process(pid) if inspect.ismethod(p.create_time): return p.create_time() else: # Process.create_time is a property in old versions of psutil. return p.create_time
endlessm/chromium-browser
[ 21, 16, 21, 3, 1435959644 ]
def _LogMapFailureDiagnostics(device): _DumpHostLog() # The device forwarder daemon logs to the logcat, so print the end of that. try: logger.info('Last 50 lines of logcat:') for logcat_line in device.adb.Logcat(dump=True)[-50:]: logger.info(' %s', logcat_line) except (device_errors.CommandFai...
endlessm/chromium-browser
[ 21, 16, 21, 3, 1435959644 ]
def __init__(self, path): self._fd = -1 self._path = path
endlessm/chromium-browser
[ 21, 16, 21, 3, 1435959644 ]
def __exit__(self, _exception_type, _exception_value, traceback): fcntl.flock(self._fd, fcntl.LOCK_UN) os.close(self._fd)
endlessm/chromium-browser
[ 21, 16, 21, 3, 1435959644 ]
def __init__(self, message): super(HostForwarderError, self).__init__(message)
endlessm/chromium-browser
[ 21, 16, 21, 3, 1435959644 ]
def Map(port_pairs, device, tool=None): """Runs the forwarder. Args: port_pairs: A list of tuples (device_port, host_port) to forward. Note that you can specify 0 as a device_port, in which case a port will by dynamically assigned on the device. You can ...
endlessm/chromium-browser
[ 21, 16, 21, 3, 1435959644 ]
def UnmapDevicePort(device_port, device): """Unmaps a previously forwarded device port. Args: device: A DeviceUtils instance. device_port: A previously forwarded port (through Map()). """ with _FileLock(Forwarder._LOCK_PATH): Forwarder._UnmapDevicePortLocked(device_port, device)
endlessm/chromium-browser
[ 21, 16, 21, 3, 1435959644 ]
def UnmapAllDevicePorts(device): """Unmaps all the previously forwarded ports for the provided device. Args: device: A DeviceUtils instance. port_pairs: A list of tuples (device_port, host_port) to unmap. """ with _FileLock(Forwarder._LOCK_PATH): instance = Forwarder._GetInstanceLocke...
endlessm/chromium-browser
[ 21, 16, 21, 3, 1435959644 ]
def DevicePortForHostPort(host_port): """Returns the device port that corresponds to a given host port.""" with _FileLock(Forwarder._LOCK_PATH): serial_and_port = Forwarder._GetInstanceLocked( None)._host_to_device_port_map.get(host_port) return serial_and_port[1] if serial_and_port else N...
endlessm/chromium-browser
[ 21, 16, 21, 3, 1435959644 ]
def RemoveHostLog(): if os.path.exists(Forwarder._HOST_FORWARDER_LOG): os.unlink(Forwarder._HOST_FORWARDER_LOG)
endlessm/chromium-browser
[ 21, 16, 21, 3, 1435959644 ]
def GetHostLog(): if not os.path.exists(Forwarder._HOST_FORWARDER_LOG): return '' with file(Forwarder._HOST_FORWARDER_LOG, 'r') as f: return f.read()
endlessm/chromium-browser
[ 21, 16, 21, 3, 1435959644 ]
def _GetInstanceLocked(tool): """Returns the singleton instance. Note that the global lock must be acquired before calling this method. Args: tool: Tool class to use to get wrapper, if necessary, for executing the forwarder (see valgrind_tools.py). """ if not Forwarder._instance:...
endlessm/chromium-browser
[ 21, 16, 21, 3, 1435959644 ]
def _UnmapDevicePortLocked(device_port, device): """Internal method used by UnmapDevicePort(). Note that the global lock must be acquired before calling this method. """ instance = Forwarder._GetInstanceLocked(None) serial = str(device) serial_with_port = (serial, device_port) if serial_wit...
endlessm/chromium-browser
[ 21, 16, 21, 3, 1435959644 ]
def _GetPidForLock(): """Returns the PID used for host_forwarder initialization. The PID of the "sharder" is used to handle multiprocessing. The "sharder" is the initial process that forks that is the parent process. """ return os.getpgrp()
endlessm/chromium-browser
[ 21, 16, 21, 3, 1435959644 ]
def _InitDeviceLocked(self, device, tool): """Initializes the device_forwarder daemon for a specific device (once). Note that the global lock must be acquired before calling this method. This method kills any existing device_forwarder daemon on the device that could be stale, pushes the latest version ...
endlessm/chromium-browser
[ 21, 16, 21, 3, 1435959644 ]
def KillHost(): """Kills the forwarder process running on the host.""" with _FileLock(Forwarder._LOCK_PATH): Forwarder._GetInstanceLocked(None)._KillHostLocked()
endlessm/chromium-browser
[ 21, 16, 21, 3, 1435959644 ]
def KillDevice(device, tool=None): """Kills the forwarder process running on the device. Args: device: Instance of DeviceUtils for talking to the device. tool: Wrapper tool (e.g. valgrind) that can be used to execute the device forwarder (see valgrind_tools.py). """ with _FileLo...
endlessm/chromium-browser
[ 21, 16, 21, 3, 1435959644 ]
def __init__(self, opts, numTests, progressBar=None): self.opts = opts self.numTests = numTests self.current = None self.progressBar = progressBar self.completed = 0
JianpingZeng/xcc
[ 36, 3, 36, 2, 1484539704 ]
def update(self, test): self.completed += 1 if self.opts.incremental: update_incremental_cache(test) if self.progressBar: self.progressBar.update(float(self.completed)/self.numTests, test.getFullName()) shouldShow = test.resu...
JianpingZeng/xcc
[ 36, 3, 36, 2, 1484539704 ]
def update_incremental_cache(test): if not test.result.code.isFailure: return fname = test.getFilePath() os.utime(fname, None)
JianpingZeng/xcc
[ 36, 3, 36, 2, 1484539704 ]
def sortIndex(test): fname = test.getFilePath() try: return -os.path.getmtime(fname) except: return 0
JianpingZeng/xcc
[ 36, 3, 36, 2, 1484539704 ]
def main(builtinParameters = {}): # Use processes by default on Unix platforms. isWindows = platform.system() == 'Windows' useProcessesIsDefault = not isWindows global options from optparse import OptionParser, OptionGroup parser = OptionParser("usage: %prog [options] {file-or-path}") pars...
JianpingZeng/xcc
[ 36, 3, 36, 2, 1484539704 ]
def home(request): """ Displays a list of messages to be translated """ def fix_nls(in_, out_): """Fixes submitted translations by filtering carriage returns and pairing newlines at the begging and end of the translated string with the original """ if 0 == len(in_) or 0 ...
20tab/upy
[ 9, 6, 9, 8, 1342021737 ]
def download_file(request): import zipfile from StringIO import StringIO storage = get_storage(request) # original filename rosetta_i18n_fn = storage.get('rosetta_i18n_fn', None) # in-session modified catalog rosetta_i18n_pofile = storage.get('rosetta_i18n_pofile', None) # language code ...
20tab/upy
[ 9, 6, 9, 8, 1342021737 ]
def list_languages(request, do_session_warn=False): """ Lists the languages for the current project, the gettext catalog files that can be translated and their translation progress """ storage = get_storage(request) languages = [] if 'filter' in request.GET: if request.GET.get('filt...
20tab/upy
[ 9, 6, 9, 8, 1342021737 ]
def get_app_name(path): app = path.split("/locale")[0].split("/")[-1] return app
20tab/upy
[ 9, 6, 9, 8, 1342021737 ]
def set_test_params(self): self.num_nodes = 2
nlgcoin/guldencoin-official
[ 136, 50, 136, 34, 1439462804 ]
def main(): print('Parsing rfc file...') item = None items = [] out = open('irc3/_rfc.py', 'w') with open('irc3/rfc1459.txt') as fd: for line in fd: line = line.replace('<host> * <host>', '<host> * <host1>') line = line.replace('<# visible>', '<visible>') ...
gawel/irc3
[ 201, 47, 201, 4, 1385813388 ]
def repl(v): v = v.lower() v = v.replace('nickname', 'nick') v = v.replace('nicks', 'nicknames') for c in '!@*': v = v.replace(c, '') for c in '| ': v = v.replace(c, '_') v = v.strip('...
gawel/irc3
[ 201, 47, 201, 4, 1385813388 ]
def msub(m): v = m.groupdict()['m'].strip('<>') v = repl(v) params.append(v) return '(?P<%s>\S+)' % v
gawel/irc3
[ 201, 47, 201, 4, 1385813388 ]
def sha3(seed): return sha3_256(bytes(seed)).digest()
HydraChain/hydrachain
[ 364, 107, 364, 37, 1440942763 ]
def DEBUG(*args, **kargs): print(FAIL + repr(args) + repr(kargs) + ENDC)
HydraChain/hydrachain
[ 364, 107, 364, 37, 1440942763 ]
def cstr(num, txt): if isinstance(num, bytes): num = big_endian_to_int(num) return '%s%s%s' % (colors[num % len(colors)], txt, ENDC)
HydraChain/hydrachain
[ 364, 107, 364, 37, 1440942763 ]
def phx(x): return x.encode('hex')[:8]
HydraChain/hydrachain
[ 364, 107, 364, 37, 1440942763 ]
def password(self): raise AttributeError('password is not a readable attribute')
abdesslem/CTF
[ 47, 18, 47, 11, 1445619879 ]
def password(self, password): self.password_hash = generate_password_hash(password)
abdesslem/CTF
[ 47, 18, 47, 11, 1445619879 ]
def __repr__(self): return '<User %r>' % self.username
abdesslem/CTF
[ 47, 18, 47, 11, 1445619879 ]
def test_scan_code_push_event(self): from wechatpy.events import ScanCodePushEvent xml = """<xml> <ToUserName><![CDATA[gh_e136c6e50636]]></ToUserName> <FromUserName><![CDATA[oMgHVjngRipVsoxg6TuX3vz6glDg]]></FromUserName> <CreateTime>1408090502</CreateTime> <MsgType><![CD...
jxtech/wechatpy
[ 3364, 745, 3364, 44, 1410527008 ]
def test_pic_sysphoto_event(self): from wechatpy.events import PicSysPhotoEvent xml = """<xml> <ToUserName><![CDATA[gh_e136c6e50636]]></ToUserName> <FromUserName><![CDATA[oMgHVjngRipVsoxg6TuX3vz6glDg]]></FromUserName> <CreateTime>1408090651</CreateTime> <MsgType><![CDATA...
jxtech/wechatpy
[ 3364, 745, 3364, 44, 1410527008 ]
def test_pic_wechat_event(self): from wechatpy.events import PicWeChatEvent xml = """<xml> <ToUserName><![CDATA[gh_e136c6e50636]]></ToUserName> <FromUserName><![CDATA[oMgHVjngRipVsoxg6TuX3vz6glDg]]></FromUserName> <CreateTime>1408090816</CreateTime> <MsgType><![CDATA[eve...
jxtech/wechatpy
[ 3364, 745, 3364, 44, 1410527008 ]
def test_merchant_order_event(self): from wechatpy.events import MerchantOrderEvent xml = """<xml> <ToUserName><![CDATA[weixin_media1]]></ToUserName> <FromUserName><![CDATA[oDF3iYyVlek46AyTBbMRVV8VZVlI]]></FromUserName> <CreateTime>1398144192</CreateTime> <MsgType><![CDA...
jxtech/wechatpy
[ 3364, 745, 3364, 44, 1410527008 ]
def test_kf_close_session_event(self): from wechatpy.events import KfCloseSessionEvent xml = """<xml> <ToUserName><![CDATA[touser]]></ToUserName> <FromUserName><![CDATA[fromuser]]></FromUserName> <CreateTime>1399197672</CreateTime> <MsgType><![CDATA[event]]></MsgType> ...
jxtech/wechatpy
[ 3364, 745, 3364, 44, 1410527008 ]
def test_template_send_job_finish_event(self): from wechatpy.events import TemplateSendJobFinishEvent xml = """<xml> <ToUserName><![CDATA[touser]]></ToUserName> <FromUserName><![CDATA[fromuser]]></FromUserName> <CreateTime>1395658920</CreateTime> <MsgType><![CDATA[event]...
jxtech/wechatpy
[ 3364, 745, 3364, 44, 1410527008 ]
def test_template_subscribe_msg_change_event(self): from wechatpy.events import SubscribeMsgChangeEvent xml = """<xml> <ToUserName><![CDATA[gh_123456789abc]]></ToUserName> <FromUserName><![CDATA[otFpruAK8D-E6EfStSYonYSBZ8_4]]></FromUserName> <CreateTime>1610969440</CreateTime> ...
jxtech/wechatpy
[ 3364, 745, 3364, 44, 1410527008 ]