Search is not available for this dataset
id int64 0 10.8M | vector listlengths 1.54k 1.54k | ast_depth int64 3 164 | ast_data stringlengths 297 510k | full_path stringlengths 0 319 | code stringlengths 60 56.5k |
|---|---|---|---|---|---|
10,901 | [
-0.024829931557178497,
-0.02857142873108387,
0.02248542197048664,
-0.0077259475365281105,
0.019302720203995705,
-0.000548924901522696,
0.021902332082390785,
0.011339893564581871,
0.014686589129269123,
0.01123056374490261,
0.010495626367628574,
0.002033224096521735,
0.0259232260286808,
-0.0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class AccumulateTest(test.TestCase):
def testSimple(self):
with self.cached_session():
random_arrays = [
np.random.rand(16, 16, 16, 16).astype(np.float32) for _ in range(20)
]
random_tensors = [
ops.convert_to_tensor(x, dtype=dtypes_lib.float32)
for x in random_arr... | |
10,902 | [
-0.00972236692905426,
-0.003829766996204853,
0.0495079830288887,
-0.05667717009782791,
0.020211249589920044,
0.016006678342819214,
-0.00013843804481439292,
-0.004621646832674742,
0.02003089338541031,
0.014879448339343071,
-0.010201439261436462,
-0.004655463621020317,
-0.01792297139763832,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dtype", "annotation": null, "type_comment": null}}], "kwarg": nul... | def _testDtype(self, dtype):
data = (np.arange(-3, 3) / 4.).reshape(1, 3, 2).astype(dtype)
self._compare(data)
# TODO: rint op is not supported for float16
if dtype is np.float16:
return
self._compare_values(data)
x = [0.5, 0.5000001]
y = [0.0, 1.0]
self._compare_values(x, y=y)
... | |
10,903 | [
-0.013793661259114742,
-0.03751278668642044,
0.04577157273888588,
-0.033955540508031845,
0.05751297250390053,
-0.016741449013352394,
0.01891808770596981,
0.026816170662641525,
0.03271174803376198,
0.00044310116209089756,
0.02075890079140663,
0.00007545352127635852,
0.030970437452197075,
0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testSimple(self):
with self.cached_session():
random_arrays = [
np.random.rand(16, 16, 16, 16).astype(np.float32) for _ in range(20)
]
random_tensors = [
ops.convert_to_tensor(x, dtype=dtypes_lib.float32)
for x in random_arrays
]
tf_val = math_ops.accu... | |
10,904 | [
-0.012791709043085575,
0.002606112975627184,
0.04522739350795746,
-0.018317338079214096,
0.03410311043262482,
-0.028893927112221718,
-0.01175717543810606,
0.005388705059885979,
0.04495963081717491,
0.048732638359069824,
0.046493176370859146,
-0.002943857805803418,
0.02848011441528797,
0.00... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dtype", "annotation": ... | class PolyvalTest(test.TestCase):
def _runtest(self, dtype, degree):
x = np.random.rand(2, 2).astype(dtype)
coeffs = [np.random.rand(2, 2).astype(dtype) for _ in range(degree + 1)]
np_val = np.polyval(coeffs, x)
with self.cached_session():
tf_val = math_ops.polyval(coeffs, x)
self.assertA... | |
10,905 | [
0.022208627313375473,
-0.005561253987252712,
-0.0032688286155462265,
-0.0029140484984964132,
-0.0010597917716950178,
-0.017077961936593056,
0.0015965104103088379,
0.01681111752986908,
0.0440291203558445,
-0.013026797212660313,
0.008211491629481316,
-0.04301026463508606,
-0.025422874838113785... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request", "annotation"... | class MobileMiddleware(object):
def process_request(self, request):
try:
logger.info('/mobile')
logger.info('Authenticating user...')
# region Getting data from meta.
facebook_id = request.META.get('HTTP_FACEBOOKID', None)
google_id = request.META... | |
10,906 | [
0.0027337034698575735,
-0.009602367877960205,
0.05665084347128868,
-0.00955857802182436,
0.024384383112192154,
-0.01917971298098564,
0.0005399376968853176,
0.013699795119464397,
0.04286346957087517,
0.014763249084353447,
0.038334403187036514,
0.011604164727032185,
0.011266360990703106,
0.0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testBroadcast(self):
dtype = np.float32
degree = 3
shapes = [(1,), (2, 1), (1, 2), (2, 2)]
for x_shape in shapes:
for coeff_shape in shapes:
x = np.random.rand(*x_shape).astype(dtype)
coeffs = [
np.random.rand(*coeff_shape).astype(dtype)
for _ in range(d... | |
10,907 | [
0.026497015729546547,
-0.02206854522228241,
-0.006624253932386637,
0.007466893643140793,
0.021096741780638695,
-0.011649338528513908,
0.030679460614919662,
0.0220931489020586,
0.04792589321732521,
0.015844084322452545,
0.014884581789374352,
-0.01931305229663849,
-0.01029004342854023,
0.001... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": n... | def process_request(self, request):
try:
logger.info('/mobile')
logger.info('Authenticating user...')
# region Getting data from meta.
facebook_id = request.META.get('HTTP_FACEBOOKID', None)
google_id = request.META.get('HTTP_GOOGLEID', None)
... | |
10,908 | [
0.007501921616494656,
0.00713832164183259,
0.012084349989891052,
-0.001431674580089748,
0.01926010102033615,
-0.011517561972141266,
-0.01914246566593647,
0.058518197387456894,
0.03193262591958046,
0.010047120973467827,
0.0018527554348111153,
-0.04829462245106697,
-0.047524645924568176,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request", "annotation"... | class BackofficeAuthMiddleware(object):
def process_request(self, request):
try:
token = request.META.get('HTTP_AUTHORIZATION', None)
jwt_util.jwt_auth_validate_token(token, raise_exception=True)
return None
except CustomException as ce:
logger.error(... | |
10,909 | [
0.00012397706450428814,
-0.022716743871569633,
-0.00610780343413353,
-0.0030921711586415768,
0.03808575123548508,
-0.026676354929804802,
-0.0329219289124012,
0.06551729142665863,
0.04335162788629532,
0.01319530513137579,
0.00478112930431962,
-0.01845097541809082,
-0.02835000492632389,
0.00... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": n... | def process_request(self, request):
try:
token = request.META.get('HTTP_AUTHORIZATION', None)
jwt_util.jwt_auth_validate_token(token, raise_exception=True)
return None
except CustomException as ce:
logger.error('Exception while authenticating user. Except... | |
10,910 | [
-0.025952288880944252,
0.02620519883930683,
0.012149329297244549,
0.009260336868464947,
0.05100967362523079,
-0.051476579159498215,
-0.014513049274682999,
0.012373055331408978,
0.02486283890902996,
0.02791719324886799,
-0.02243102714419365,
-0.010019062086939812,
0.010077426210045815,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "v", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "vtype", "annotation": null, "type_comment": null}}], "kwarg": null, ... | def _empty_ipaddr_query(v, vtype):
# We don't have any query to process, so just check what type the user
# expects, and return the IP address in a correct format
if v:
if vtype == 'address':
return str(v.ip)
elif vtype == 'network':
return str(v) | |
10,911 | [
-0.0194848719984293,
-0.027329744771122932,
0.017969246953725815,
-0.011306560598313808,
0.005065217614173889,
-0.03171899542212486,
-0.012385684996843338,
-0.009966747835278511,
0.008463248610496521,
0.022552495822310448,
0.015835247933864594,
-0.02331637032330036,
0.03909099102020264,
0.... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "v", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "vtype", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def _6to4_query(v, vtype, value):
if v.version == 4:
if v.size == 1:
ipconv = str(v.ip)
elif v.size > 1:
if v.ip != v.network:
ipconv = str(v.ip)
else:
ipconv = False
if ipaddr(ipconv, 'public'):
numbers = list... | |
10,912 | [
0.005854044109582901,
-0.015987452119588852,
-0.023248769342899323,
0.011425587348639965,
0.013015962205827236,
-0.022160617634654045,
-0.004752814304083586,
-0.011802255176007748,
0.029484711587429047,
0.04532568156719208,
0.008888311684131622,
0.004391841124743223,
0.029296377673745155,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "v", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}], "kwarg": null, ... | def _ipv4_query(v, value):
if v.version == 6:
try:
return str(v.ipv4())
except:
return False
else:
return value | |
10,913 | [
-0.018925147131085396,
0.0041582933627069,
0.016163865104317665,
-0.032546013593673706,
-0.013086073100566864,
-0.014232059940695763,
-0.04741109535098076,
0.001829485408961773,
-0.0212062057107687,
0.0312363151460886,
-0.012835047207772732,
-0.036737050861120224,
0.03267698362469673,
0.01... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "v", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def _type_query(v):
if v.size == 1:
return 'address'
if v.size > 1:
if v.ip != v.network:
return 'address'
else:
return 'network' | |
10,914 | [
-0.017639292404055595,
-0.0027070462238043547,
-0.0006718193180859089,
0.004523165989667177,
0.027223344892263412,
-0.05596495419740677,
-0.013959608040750027,
-0.005830561276525259,
-0.009030517190694809,
0.028889218345284462,
-0.006500074174255133,
0.025494208559393883,
0.01095470786094665... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "v", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}], "kwarg": null, ... | def _link_local_query(v, value):
v_ip = netaddr.IPAddress(str(v.ip))
if v.version == 4:
if ipaddr(str(v_ip), '169.254.0.0/24'):
return value
elif v.version == 6:
if ipaddr(str(v_ip), 'fe80::/10'):
return value | |
10,915 | [
-0.0020095063373446465,
0.01725129410624504,
-0.025575043633580208,
0.001923249801620841,
0.02277170866727829,
-0.05071880668401718,
-0.023138297721743584,
-0.011989649385213852,
0.027386430650949478,
0.018146205693483353,
0.007682216819375753,
-0.003345133736729622,
0.053565267473459244,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "query", "annotation": null, "type_comment": null}}], "kwarg": nu... | def ipwrap(value, query = ''):
try:
if isinstance(value, (list, tuple)):
_ret = []
for element in value:
if ipaddr(element, query, version = False, alias = 'ipwrap'):
_ret.append(ipaddr(element, 'wrap'))
else:
_r... | |
10,916 | [
-0.010837015695869923,
-0.007304127793759108,
-0.01229890063405037,
-0.012447208166122437,
-0.007876169867813587,
-0.014449354261159897,
-0.006085890345275402,
-0.011440837755799294,
0.024216439574956894,
0.030953822657465935,
-0.03408946096897125,
-0.009195043705403805,
0.0714840516448021,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "v", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "vtype", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def _wrap_query(v, vtype, value):
if v.version == 6:
if vtype == 'address':
return '[' + str(v.ip) + ']'
elif vtype == 'network':
return '[' + str(v.ip) + ']/' + str(v.prefixlen)
else:
return value | |
10,917 | [
0.027496686205267906,
0.017316527664661407,
0.053762175142765045,
0.019984116777777672,
-0.0009184086811728776,
0.012425947934389114,
0.011143453419208527,
-0.03253546357154846,
-0.03404025733470917,
0.057546958327293396,
-0.011377152986824512,
-0.021648509427905083,
0.014078941196203232,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def check(self, **kwargs):
errors = super(ArrayField, self).check(**kwargs)
if self.base_field.remote_field:
errors.append(
checks.Error(
'Base field for array cannot be a related field.',
hint=None,
obj=self,
... | |
10,918 | [
0.03583125025033951,
-0.005935968365520239,
0.029708189889788628,
0.01171319093555212,
0.009768551215529442,
0.012404869310557842,
0.00620810454711318,
-0.03195331245660782,
-0.009133567102253437,
0.059280309826135635,
-0.023517092689871788,
-0.013323329389095306,
0.018766051158308983,
-0.... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": false}}, "targets": [{"_type": "Name", "_fields": {"id": "empty_strings_allowed", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comme... | class ArrayField(Field):
empty_strings_allowed = False
default_error_messages = {
'item_invalid': _('Item %(nth)s in the array did not validate: '),
'nested_array_mismatch': _('Nested arrays must have the same length.'),
}
def __init__(self, base_field, size=None, **kwargs):
sel... | |
10,919 | [
0.03418530523777008,
-0.012213439680635929,
-0.0118641909211874,
0.006758993491530418,
-0.0024896825198084116,
-0.0000967817468335852,
0.00002132649206032511,
-0.011905279010534286,
-0.010991068556904793,
0.03381551057100296,
0.006158079952001572,
-0.03730800002813339,
0.038704995065927505,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def deconstruct(self):
name, path, args, kwargs = super(ArrayField, self).deconstruct()
if path == 'django.contrib.postgres.fields.array.ArrayField':
path = 'django.contrib.postgres.fields.ArrayField'
kwargs.update({
'base_field': self.base_field,
'size': self... | |
10,920 | [
0.03474612906575203,
0.00825122743844986,
0.0021300590597093105,
-0.03277013823390007,
-0.03476569429039955,
-0.00012930754746776074,
-0.03591998666524887,
-0.05110185220837593,
0.036350399255752563,
-0.019466441124677658,
0.029992014169692993,
-0.005678527057170868,
0.008603384718298912,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "obj", "annotation": null, "type_comment": null}}], "kwarg": null,... | def value_to_string(self, obj):
values = []
vals = self._get_val_from_obj(obj)
base_field = self.base_field
for val in vals:
obj = AttributeSetter(base_field.attname, val)
values.append(base_field.value_to_string(obj))
return json.dumps(values) | |
10,921 | [
0.0202522911131382,
-0.03506430238485336,
0.00018910152721218765,
-0.0024784088600426912,
0.02061356045305729,
-0.02866772562265396,
0.027966439723968506,
-0.026500113308429718,
-0.052277687937021255,
-0.009371732361614704,
-0.0001271745131816715,
-0.0022061290219426155,
0.037550680339336395... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}], "kwarg": null... | def get_transform(self, name):
transform = super(ArrayField, self).get_transform(name)
if transform:
return transform
try:
index = int(name)
except ValueError:
pass
else:
index += 1 # postgres uses 1-indexing
return Ind... | |
10,922 | [
0.04139215871691704,
0.007314533926546574,
-0.015354122966527939,
0.0016420382307842374,
0.015642013400793076,
0.005469906609505415,
0.027744047343730927,
-0.025142377242445946,
0.0020512149203568697,
0.04286359250545502,
0.008274166844785213,
-0.013114980421960354,
-0.01041734591126442,
-... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}, {"_type": "ar... | def validate(self, value, model_instance):
super(ArrayField, self).validate(value, model_instance)
for i, part in enumerate(value):
try:
self.base_field.validate(part, model_instance)
except exceptions.ValidationError as e:
raise exceptions.Validat... | |
10,923 | [
0.0542110912501812,
-0.007655764929950237,
0.027891812846064568,
0.010831872932612896,
0.009424867108464241,
-0.004715019837021828,
0.018963536247611046,
-0.03176107630133629,
-0.02280176430940628,
0.03722357004880905,
-0.05553533136844635,
-0.02936089225113392,
0.024726051837205887,
-0.00... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def formfield(self, **kwargs):
defaults = {
'form_class': SimpleArrayField,
'base_field': self.base_field.formfield(),
'max_length': self.size,
}
defaults.update(kwargs)
return super(ArrayField, self).formfield(**defaults) | |
10,924 | [
0.054592616856098175,
0.037320759147405624,
0.0031665072310715914,
0.007157096639275551,
0.003496704623103142,
-0.023661315441131592,
0.01536405086517334,
-0.014607702381908894,
0.016052667051553726,
0.04122668132185936,
0.015251163393259048,
0.0156124047935009,
-0.0036293480079621077,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}], "kwarg": nul... | def run_validators(self, value):
super(ArrayField, self).run_validators(value)
for i, part in enumerate(value):
try:
self.base_field.run_validators(part)
except exceptions.ValidationError as e:
raise exceptions.ValidationError(
... | |
10,925 | [
0.022779343649744987,
-0.010094300843775272,
0.002248908393085003,
-0.023815641179680824,
-0.004008454270660877,
-0.03584820032119751,
-0.01692618429660797,
-0.03172220289707184,
-0.0726175531744957,
0.014009200036525726,
0.008251994848251343,
-0.07016114890575409,
0.05350362882018089,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "start", "annotation": ... | class SliceTransform(Transform):
def __init__(self, start, end, *args, **kwargs):
super(SliceTransform, self).__init__(*args, **kwargs)
self.start = start
self.end = end
def as_sql(self, compiler, connection):
lhs, params = compiler.compile(self.lhs)
return '%s[%s:%s]' ... | |
10,926 | [
0.010185524821281433,
-0.016407320275902748,
0.03674929589033127,
-0.02690296620130539,
0.006202412769198418,
-0.04120728000998497,
-0.012792476452887058,
0.00020836231124121696,
-0.07167663425207138,
0.007195767946541309,
0.0009757897933013737,
-0.016872501000761986,
0.051596321165561676,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "index", "annotation": ... | class IndexTransform(Transform):
def __init__(self, index, base_field, *args, **kwargs):
super(IndexTransform, self).__init__(*args, **kwargs)
self.index = index
self.base_field = base_field
def as_sql(self, compiler, connection):
lhs, params = compiler.compile(self.lhs)
... | |
10,927 | [
0.001112222671508789,
-0.031775884330272675,
0.02639986388385296,
-0.05210604891180992,
-0.0057195257395505905,
-0.009958311915397644,
0.032923124730587006,
0.007490410935133696,
-0.011205601505935192,
-0.013093211688101292,
0.05039852857589722,
-0.020917123183608055,
-0.026493243873119354,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":... | def migrate_v071_baskets():
default_topic_name = ''
default_share_level = ''
print("Basket migration kit (for CDSware prior to v0.7.1 -> v0.90)")
print("===============================")
print("Checking your installation...")
if __check_update_possibility():
print("Tables are OK, please ... | |
10,928 | [
0.031064944341778755,
-0.03177500143647194,
0.023507921025156975,
-0.008805961348116398,
0.0406760573387146,
-0.01013097632676363,
0.011830038391053677,
0.004200107418000698,
0.00648876978084445,
0.013858769088983536,
0.055029332637786865,
-0.018854519352316856,
-0.02677925117313862,
0.037... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg... | def choose_share_level():
print("===============================")
print("Public baskets now have share levels. Please choose between:")
print(" 0: current public baskets should not be public anymore")
print(" 1: people can view content [default]")
print(" 2: people can view c... | |
10,929 | [
0.010859185829758644,
-0.007930731400847435,
0.009096136316657066,
-0.038273099809885025,
0.0010817350121214986,
-0.009556322358548641,
-0.006000342313200235,
-0.010793444700539112,
0.009096136316657066,
0.0031944054644554853,
0.011158007197082043,
-0.023379821330308914,
0.017391430214047432... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "r", "annotation": null, "type_comment": null}}], "kwarg": null, "... | def __setup_r__(self, r):
# sets up r so it belongs to this fgraph
if getattr(r, 'cached', False):
raise CachedConstantError(
"You manually constructed a FunctionGraph, but you passed it a"
" graph that has a cached constant. This should not happen."
... | |
10,930 | [
0.0014174544485285878,
-0.010423184372484684,
-0.009953358210623264,
-0.051599692553281784,
-0.005278295837342739,
0.00773183349519968,
0.01493003685027361,
-0.02247045934200287,
-0.018131816759705544,
0.03271383419632912,
0.049001146107912064,
0.004080528859049082,
-0.008503276854753494,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}}], "kwarg": null... | def __setup_node__(self, node):
# sets up node so it belongs to this fgraph
if hasattr(node, 'fgraph') and node.fgraph is not self:
raise Exception("%s is already owned by another fgraph" % node)
if (hasattr(node.op, 'view_map') and
not all(isinstance(view, (list, tuple))... | |
10,931 | [
0.0006525154458358884,
0.019671747460961342,
-0.006245187483727932,
-0.03446111083030701,
-0.009118922054767609,
0.00687326118350029,
-0.023914208635687828,
-0.010659480467438698,
-0.013568766415119171,
0.08423300087451935,
-0.0093500055372715,
-0.018024535849690437,
0.024648936465382576,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "op1", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "operator_list", "annotation": null, "type_comment": null}}, {"_typ... | def _pop_a_match_at_tier(op1, operator_list, tier):
# Search from the back of list to the front in order to create nice default
# order of operations.
for i in range(1, len(operator_list) + 1):
op2 = operator_list[-i]
for adder in tier:
if adder.can_add(op1, op2):
return operator_list.pop(-i... | |
10,932 | [
0.02373291179537773,
0.006982867605984211,
-0.029102647677063942,
-0.0009640114149078727,
-0.020097842440009117,
0.004027302842587233,
-0.0009943956974893808,
-0.04295789450407028,
-0.0075960783287882805,
0.020583990961313248,
-0.048791684210300446,
-0.011711771599948406,
0.01961169391870498... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "op1", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def _add(self, op1, op2, operator_name, hints):
# Will build a LinearOperatorScaledIdentity.
if _type(op1) == _SCALED_IDENTITY:
multiplier_1 = op1.multiplier
else:
multiplier_1 = array_ops.ones(op1.batch_shape_tensor(), dtype=op1.dtype)
if _type(op2) == _SCALED_IDENTITY:
multiplier_2... | |
10,933 | [
-0.004781000316143036,
-0.015506247989833355,
-0.024823354557156563,
-0.013658410869538784,
0.018678739666938782,
0.0476430281996727,
0.004989716690033674,
-0.004483231343328953,
0.0017671333625912666,
0.041765570640563965,
-0.03299391269683838,
0.025825193151831627,
0.014671381562948227,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "op1", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def _add(self, op1, op2, operator_name, hints):
if _type(op1) in _EFFICIENT_ADD_TO_TENSOR:
op_add_to_tensor, op_other = op1, op2
else:
op_add_to_tensor, op_other = op2, op1
return linear_operator_lower_triangular.LinearOperatorLowerTriangular(
tril=op_add_to_tensor.add_to_tensor(op_othe... | |
10,934 | [
-0.007470869924873114,
-0.01077309250831604,
-0.051484156399965286,
-0.011911978013813496,
0.002299567451700568,
0.03688026964664459,
0.00641372287645936,
-0.014767364598810673,
0.0029316761065274477,
0.04267822951078415,
-0.02524075098335743,
0.026548562571406364,
0.009797683916985989,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "op1", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def _add(self, op1, op2, operator_name, hints):
if _type(op1) in _EFFICIENT_ADD_TO_TENSOR:
op_add_to_tensor, op_other = op1, op2
else:
op_add_to_tensor, op_other = op2, op1
return linear_operator_full_matrix.LinearOperatorFullMatrix(
matrix=op_add_to_tensor.add_to_tensor(op_other.to_dens... | |
10,935 | [
0.02956845425069332,
-0.020068082958459854,
0.01590440422296524,
-0.05516345053911209,
-0.03202016279101372,
-0.0030857715755701065,
0.03191448748111725,
-0.00341601250693202,
-0.00813713762909174,
0.006499141920357943,
-0.007027527783066034,
-0.007598184049129486,
-0.00715962378308177,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "meta", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "size", "annotation": null, "type_comment": null}}], "kwarg": null... | def computeComprRate(meta, size):
if not meta.has("duration") \
or not meta.has("sample_rate") \
or not meta.has("bits_per_sample") \
or not meta.has("nb_channel") \
or not size:
return
orig_size = timedelta2seconds(meta.get("duration")) * meta.get('sample_rate') * meta.get('bits_per_sam... | |
10,936 | [
0.03171386197209358,
0.026621971279382706,
-0.020088544115424156,
-0.023239005357027054,
-0.0018382529960945249,
0.03548046201467514,
0.016542823985219002,
0.006992627400904894,
0.019867664203047752,
-0.029946811497211456,
-0.0017437973292544484,
0.0008275771397165954,
0.00558596383780241,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "metadata", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "comment", "annotation": null, "type_comment": null}}], "kwarg... | def readVorbisComment(metadata, comment):
metadata.producer = getValue(comment, "vendor")
for item in comment.array("metadata"):
if "=" in item.value:
key, value = item.value.split("=", 1)
key = key.upper()
if key in VORBIS_KEY_TO_ATTR:
key = VORBIS_KE... | |
10,937 | [
0.019478866830468178,
0.0285587590187788,
-0.006031917408108711,
-0.03567923977971077,
-0.03352772817015648,
0.0027406164444983006,
0.017519453540444374,
-0.01629001833498478,
-0.030710270628333092,
-0.01113535463809967,
0.10066001862287521,
-0.026893898844718933,
-0.036447636783123016,
0.... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "ogg", "annotation": null, "type_comment": null}}], "kwarg": null,... | def extract(self, ogg):
granule_quotient = None
for index, page in enumerate(ogg.array("page")):
if "segments" not in page:
continue
page = page["segments"]
if "vorbis_hdr" in page:
meta = Metadata(self)
self.vorbisHeade... | |
10,938 | [
0.017222989350557327,
0.05923860892653465,
0.01628119871020317,
-0.06451263278722763,
-0.011566361412405968,
0.008511429652571678,
0.03599993512034416,
-0.035717397928237915,
-0.038966573774814606,
-0.020589889958500862,
0.08589127659797668,
-0.019695188850164413,
-0.05151592940092087,
0.0... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "ogg", "annotation": nu... | class OggMetadata(MultipleMetadata):
def extract(self, ogg):
granule_quotient = None
for index, page in enumerate(ogg.array("page")):
if "segments" not in page:
continue
page = page["segments"]
if "vorbis_hdr" in page:
meta = Metada... | |
10,939 | [
-0.007276621181517839,
0.03389446809887886,
-0.011313002556562424,
-0.06097441166639328,
0.0011190519435331225,
0.013951960951089859,
-0.020488115027546883,
-0.018840158358216286,
-0.023026859387755394,
-0.030019542202353477,
0.03456255793571472,
-0.038482025265693665,
-0.02828250639140606,
... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "audio", "annotation": ... | class AuMetadata(RootMetadata):
def extract(self, audio):
self.sample_rate = audio["sample_rate"].value
self.nb_channel = audio["channels"].value
self.compression = audio["codec"].display
if "info" in audio:
self.comment = audio["info"].value
self.bits_per_sample ... | |
10,940 | [
0.013966202735900879,
0.009045644663274288,
-0.0005103090079501271,
-0.06654685735702515,
-0.007306972052901983,
-0.024205055087804794,
0.04084176942706108,
0.010363854467868805,
0.0024020392447710037,
-0.022068645805120468,
0.013261642307043076,
0.013307098299264908,
-0.06000126153230667,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "header", "annotation": null, "type_comment": null}}, {"_type": "a... | def theoraHeader(self, header, meta):
meta.compression = "Theora"
meta.format_version = "Theora version %u.%u (revision %u)" % (\
header["version_major"].value,
header["version_minor"].value,
header["version_revision"].value)
meta.width = header["frame_width"]... | |
10,941 | [
-0.01785123161971569,
-0.022754712030291557,
-0.007697075139731169,
-0.059525471180677414,
-0.006666169036179781,
0.010309060104191303,
-0.01687908172607422,
-0.007819929160177708,
0.010971403680741787,
-0.0037684154231101274,
0.04315917193889618,
0.0006720251985825598,
-0.04670591652393341,... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "audio", "annotation": null, "type_comment": null}}], "kwarg": nul... | def extract(self, audio):
self.sample_rate = audio["sample_rate"].value
self.nb_channel = audio["channels"].value
self.compression = audio["codec"].display
if "info" in audio:
self.comment = audio["info"].value
self.bits_per_sample = audio.getBitsPerSample()
c... | |
10,942 | [
-0.016844239085912704,
0.017910923808813095,
0.029421741142868996,
-0.04344102367758751,
0.012636110186576843,
0.006552491337060928,
-0.03619694709777832,
-0.006757623050361872,
-0.03643138334155083,
-0.017864037305116653,
0.013773125596344471,
0.0015238352352753282,
-0.010367940180003643,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"keys": [{"_type": "Constant", "_fields": {"kind": "u", "value": "28_8"}}, {"_type": "Constant", "_fields": {"kind": "u", "value": "14_4"}}, {"_type": "Constant", "_... | class RealAudioMetadata(RootMetadata):
FOURCC_TO_BITRATE = {
u"28_8": 15200, # 28.8 kbit/sec (audio bit rate: 15.2 kbit/s)
u"14_4": 8000, # 14.4 kbit/sec
u"lpcJ": 8000, # 14.4 kbit/sec
}
def extract(self, real):
version = real["version"].value
if "metadata" in real... | |
10,943 | [
0.026354840025305748,
0.0060020009987056255,
-0.006689109373837709,
-0.06018943339586258,
0.0073354304768145084,
0.015436406247317791,
-0.030446115881204605,
-0.012964071705937386,
-0.007806052919477224,
0.01356646791100502,
0.04455222934484482,
0.0032253304962068796,
-0.039783257991075516,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "real", "annotation": null, "type_comment": null}}], "kwarg": null... | def extract(self, real):
version = real["version"].value
if "metadata" in real:
self.useMetadata(real["metadata"])
self.useRoot(real)
self.format_version = "Real audio version %s" % version
if version == 3:
size = getValue(real, "data_size")
elif "... | |
10,944 | [
0.0027614987920969725,
-0.024568451568484306,
-0.0003177945618517697,
0.0060685547068715096,
0.0044104293920099735,
-0.017090030014514923,
-0.03802960738539696,
0.01830374076962471,
-0.026603562757372856,
0.01690613478422165,
0.0009018546552397311,
0.017126809805631638,
-0.000525251787621527... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "real", "annotation": null, "type_comment": null}}], "kwarg": null... | def useRoot(self, real):
self.bits_per_sample = 16 # FIXME: Is that correct?
if real["version"].value != 3:
self.sample_rate = real["sample_rate"].value
self.nb_channel = real["channels"].value
else:
self.sample_rate = 8000
self.nb_channel = 1
... | |
10,945 | [
0.05261903256177902,
0.04319300130009651,
-0.0018310705199837685,
-0.049237702041864395,
0.03344273194670677,
0.005963644944131374,
-0.0023883527610450983,
-0.04108545929193497,
-0.018284650519490242,
-0.021828098222613335,
0.01572549343109131,
-0.012529443949460983,
0.016177110373973846,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"keys": [{"_type": "Constant", "_fields": {"kind": null, "value": "generated by"}}, {"_type": "Constant", "_fields": {"kind": null, "value": "creation date"}}, {"_ty... | class RealMediaMetadata(MultipleMetadata):
KEY_TO_ATTR = {
"generated by": "producer",
"creation date": "creation_date",
"modification date": "last_modification",
"description": "comment",
}
def extract(self, media):
if "file_prop" in media:
self.useFileP... | |
10,946 | [
0.06343255937099457,
0.017514102160930634,
-0.017111610621213913,
-0.045009974390268326,
-0.010562509298324585,
0.03173927962779999,
0.00798081886023283,
-0.03100329451262951,
-0.0028260606341063976,
-0.010976499877870083,
0.026334401220083237,
0.0005749869160354137,
0.028358355164527893,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "stream", "annotation": null, "type_comment": null}}, {"_type": "a... | def useStreamProp(self, stream, index):
meta = Metadata(self)
meta.comment = "Start: %s" % stream["stream_start"].value
if getValue(stream, "mime_type") == "logical-fileinfo":
for prop in stream.array("file_info/prop"):
self.useFileInfoProp(prop)
else:
... | |
10,947 | [
0.020205970853567123,
0.026827482506632805,
0.0005197824793867767,
-0.07301952689886093,
0.005566702224314213,
-0.016096489503979683,
0.04528966546058655,
0.024766642600297928,
-0.0333392433822155,
0.005609382409602404,
0.06623949110507965,
0.006008746102452278,
-0.02504711225628853,
0.006... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"keys": [{"_type": "Constant", "_fields": {"kind": null, "value": "TP1"}}, {"_type": "Constant", "_fields": {"kind": null, "value": "COM"}}, {"_type": "Constant", "_... | class MpegAudioMetadata(RootMetadata):
TAG_TO_KEY = {
# ID3 version 2.2
"TP1": "author",
"COM": "comment",
"TEN": "producer",
"TRK": "track_number",
"TAL": "album",
"TT2": "title",
"TYE": "creation_date",
"TCO": "music_genre",
# ID3 ve... | |
10,948 | [
0.026294786483049393,
-0.0227288119494915,
-0.04053589701652527,
-0.06471160799264908,
0.0296670813113451,
-0.04217647388577461,
0.03458881005644798,
0.02211359702050686,
-0.0034264111891388893,
0.009233935736119747,
0.06452932208776474,
0.005457193590700626,
-0.02807207591831684,
0.026021... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "field", "annotation": null, "type_comment": null}}], "kwarg": nul... | def processID3v2(self, field):
# Read value
if "content" not in field:
return
content = field["content"]
if "text" not in content:
return
if "title" in content and content["title"].value:
value = "%s: %s" % (content["title"].value, content["tex... | |
10,949 | [
0.009003710933029652,
-0.003626160090789199,
-0.03883150964975357,
-0.0854630321264267,
0.005154864862561226,
0.00724028330296278,
0.007294449955224991,
-0.0003690106968861073,
0.008660654537379742,
0.010773156769573689,
0.06504819542169571,
0.012590750120580196,
-0.013276861980557442,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "mp3", "annotation": null, "type_comment": null}}], "kwarg": null,... | def extract(self, mp3):
if "/frames/frame[0]" in mp3:
frame = mp3["/frames/frame[0]"]
self.nb_channel = (frame.getNbChannel(), frame["channel_mode"].display)
self.format_version = u"MPEG version %s layer %s" % \
(frame["version"].display, frame["layer"].displa... | |
10,950 | [
0.020361704751849174,
0.005504795350134373,
-0.02458771876990795,
-0.06287430971860886,
-0.06787966936826706,
-0.027968531474471092,
0.0251365527510643,
0.03606930747628212,
0.01617959700524807,
-0.006185348145663738,
0.07262158393859863,
0.023029033094644547,
-0.03222747519612312,
-0.0276... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "mp3", "annotation": null, "type_comment": null}}], "kwarg": null,... | def computeVariableBitrate(self, mp3):
if self.quality <= QUALITY_FAST:
return
count = 0
if QUALITY_BEST <= self.quality:
self.warning("Process all MPEG audio frames to compute exact duration")
max_count = None
else:
max_count = 500 * self.... | |
10,951 | [
0.009438585489988327,
-0.003359645139425993,
0.03885375335812569,
-0.043017491698265076,
0.02221049927175045,
-0.0006465635378845036,
-0.012432733550667763,
-0.004271924961358309,
-0.01871342770755291,
0.006333325989544392,
0.007701745256781578,
-0.05015198886394501,
-0.034456100314855576,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "aiff", "annotation": n... | class AiffMetadata(RootMetadata):
def extract(self, aiff):
if "common" in aiff:
self.useCommon(aiff["common"])
computeBitRate(self)
@fault_tolerant
def useCommon(self, info):
self.nb_channel = info["nb_channel"].value
self.bits_per_sample = info["sample_size"].va... | |
10,952 | [
0.03936685621738434,
-0.029441120103001595,
-0.0049180565401911736,
-0.02368284948170185,
0.013196971267461777,
-0.0015277903294190764,
0.020602062344551086,
0.0019016858423128724,
-0.004789223428815603,
0.008430153131484985,
0.0009746489813551307,
0.016524221748113632,
-0.016255352646112442... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "info", "annotation": null, "type_comment": null}}], "kwarg": null... | def useCommon(self, info):
self.nb_channel = info["nb_channel"].value
self.bits_per_sample = info["sample_size"].value
self.sample_rate = getValue(info, "sample_rate")
if self.has("sample_rate"):
rate = self.get("sample_rate")
if rate:
sec = float(... | |
10,953 | [
0.042438384145498276,
-0.032705001533031464,
0.010588482022285461,
-0.027679959312081337,
0.0059118145145475864,
0.012615390121936798,
0.006624399218708277,
-0.022612690925598145,
-0.03487970679998398,
0.0187066700309515,
0.01965678296983242,
0.020955270156264305,
-0.02114529348909855,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "info", "annotation": null, "type_comment": null}}], "kwarg": null... | def useStreamInfo(self, info):
self.nb_channel = info["nb_channel"].value + 1
self.bits_per_sample = info["bits_per_sample"].value + 1
self.sample_rate = info["sample_hertz"].value
sec = info["total_samples"].value
if sec:
sec = float(sec) / info["sample_hertz"].value... | |
10,954 | [
0.016621140763163567,
0.03823445737361908,
-0.012235492467880249,
-0.050901513546705246,
0.044742945581674576,
0.020738517865538597,
-0.016912739723920822,
-0.018848957493901253,
-0.038607701659202576,
0.009546949528157711,
0.01613125391304493,
-0.007284142076969147,
-0.004811382852494717,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "flac", "annotation": n... | class FlacMetadata(RootMetadata):
def extract(self, flac):
if "metadata/stream_info/content" in flac:
self.useStreamInfo(flac["metadata/stream_info/content"])
if "metadata/comment/content" in flac:
readVorbisComment(self, flac["metadata/comment/content"])
@fault_tolerant... | |
10,955 | [
0.017016390338540077,
0.028087813407182693,
0.040257763117551804,
-0.048249006271362305,
-0.009030533954501152,
-0.009138232097029686,
-0.05436629056930542,
-0.02500763162970543,
0.00019217481894884259,
0.02718314528465271,
-0.026881588622927666,
-0.03265423700213432,
-0.015616307035088539,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "sigs_str", "annotation": null, "type_comment": null}}, {"_type": ... | def _parse_signatures(self, sigs_str, headers_str):
sigs = [x.strip() for x in sigs_str.split(",") if x.strip()]
headers = [x.strip() for x in headers_str.split(",") if x.strip()]
if len(headers) == 1:
headers = headers * len(sigs)
if len(headers) != len(sigs):
ra... | |
10,956 | [
0.027546469122171402,
0.04749986529350281,
0.003073901403695345,
-0.013287882320582867,
-0.006778761278837919,
-0.009237882681190968,
-0.030868440866470337,
-0.02614433877170086,
0.0204926747828722,
-0.01604899950325489,
0.0055653792805969715,
-0.00625026598572731,
-0.02914274111390114,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def __init__(self, name, signatures, headers):
self.name = name
self.signatures = self._parse_signatures(signatures, headers)
self.doc = add_newdocs.get("scipy.special." + name)
if self.doc is None:
raise ValueError("No docstring for ufunc %r" % name)
self.doc = textw... | |
10,957 | [
0.03686638921499252,
0.0017535198712721467,
-0.017450254410505295,
-0.047035593539476395,
-0.05514182895421982,
0.017025524750351906,
-0.033128783106803894,
-0.05048195645213127,
-0.000006020140062901191,
0.04800640046596527,
0.012183626182377338,
-0.021903829649090767,
0.025240978226065636,... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "sig", "annotation": null, "type_comment": null}}], "kwarg": null,... | def _parse_signature(self, sig):
m = re.match("\s*(.*):\s*([fdgFDGil]*)\s*\\*\s*([fdgFDGil]*)\s*->\s*([*fdgFDGil]*)\s*$", sig)
if m:
func, inarg, outarg, ret = [x.strip() for x in m.groups()]
if ret.count('*') > 1:
raise ValueError("%s: Invalid signature: %r" % (s... | |
10,958 | [
0.022998856380581856,
0.044162567704916,
0.00960470363497734,
-0.07545531541109085,
-0.031245077028870583,
-0.004182693548500538,
-0.016158781945705414,
-0.09056544303894043,
0.012440831400454044,
0.03353304788470268,
0.01746959798038006,
-0.02175953984260559,
0.015038629993796349,
-0.0294... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "all_loops", "annotation": null, "type_comment": null}}], "kwarg":... | def _get_signatures_and_loops(self, all_loops):
inarg_num = None
outarg_num = None
seen = set()
variants = []
def add_variant(func_name, inarg, outarg, ret, inp, outp):
if inp in seen:
return
seen.add(inp)
sig = (func_name, i... | |
10,959 | [
0.047517020255327225,
0.031113486737012863,
0.004708757624030113,
-0.052017103880643845,
-0.025790806859731674,
-0.004273265600204468,
-0.05153322219848633,
-0.0018553775735199451,
0.0028987438417971134,
0.04420244321227074,
0.016609182581305504,
-0.03774264454841614,
0.04023462533950806,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def get_prototypes(self):
prototypes = []
for func_name, inarg, outarg, ret, header in self.signatures:
ret = ret.replace('*', '')
c_args = ([C_TYPES[x] for x in inarg]
+ [C_TYPES[x] + ' *' for x in outarg])
cy_args = ([CY_TYPES[x] for x in inarg... | |
10,960 | [
0.06570042669773102,
0.020168397575616837,
-0.032124243676662445,
0.0059949373826384544,
-0.006998819764703512,
0.049139201641082764,
0.0072653875686228275,
-0.009494347497820854,
0.021200640127062798,
-0.01056628953665495,
0.018693769350647926,
-0.046121884137392044,
0.009817631915211678,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "c_name", "annotation": null, "type_comment": null}}, {"_type": "a... | def cython_func_name(self, c_name, specialized=False, prefix="_func_",
override=True):
# act on function name overrides
if override and c_name in self.function_name_overrides:
c_name = self.function_name_overrides[c_name]
prefix = ""
# support fu... | |
10,961 | [
-0.03368399292230606,
0.0623246431350708,
0.008958877995610237,
-0.043423667550086975,
0.026280919089913368,
0.03396160900592804,
-0.02491597644984722,
-0.025887630879878998,
0.028316764160990715,
0.051405105739831924,
0.0013063825899735093,
-0.03898182138800621,
0.007241133600473404,
0.01... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "ufunc_str", "annotation": null, "type_comment": null}}], "kwarg": ... | def parse_all(cls, ufunc_str):
ufuncs = []
lines = ufunc_str.splitlines()
lines.sort()
for line in lines:
line = line.strip()
if not line:
continue
m = re.match("^([a-z0-9_]+)\s*--\s*(.*?)\s*--(.*)$", line)
if not m:
... | |
10,962 | [
0.012933610938489437,
0.042698632925748825,
0.028018604964017868,
-0.039155177772045135,
-0.0034200670197606087,
0.0020390686113387346,
-0.038927383720874786,
-0.049886785447597504,
0.0510004423558712,
0.049456506967544556,
0.012465368956327438,
-0.018122240900993347,
0.0015921819722279906,
... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "all_loops", "annotation": null, "type_comment": null}}], "kwarg":... | def generate(self, all_loops):
toplevel = ""
variants, inarg_num, outarg_num = self._get_signatures_and_loops(all_loops)
loops = []
funcs = []
types = []
for func_name, loop_name, inputs, outputs in variants:
for x in inputs:
types.append(TY... | |
10,963 | [
-0.014677038416266441,
0.00616912916302681,
-0.034198690205812454,
-0.05111904814839363,
-0.05517611652612686,
-0.029282480478286743,
0.008549672551453114,
-0.08028220385313034,
0.019175609573721886,
0.04983033239841461,
0.01786302961409092,
-0.034270286560058594,
0.040594540536403656,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "func_name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "inarg", "annotation": null, "type_comment": null}}, {"_type"... | def add_variant(func_name, inarg, outarg, ret, inp, outp):
if inp in seen:
return
seen.add(inp)
sig = (func_name, inp, outp)
if "v" in outp:
raise ValueError("%s: void signature %r" % (self.name, sig))
if len(inp) != inarg_num ... | |
10,964 | [
0.02198406122624874,
0.027548082172870636,
0.052079230546951294,
-0.04715816304087639,
0.003536243923008442,
-0.008506768383085728,
0.0026336361188441515,
-0.03615376725792885,
0.04394339397549629,
0.0051127164624631405,
0.039937298744916916,
-0.013118723407387733,
0.039244890213012695,
-0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "filename", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cxx_fn_prefix", "annotation": null, "type_comment": null}}, {... | def generate(filename, cxx_fn_prefix, ufuncs):
proto_h_filename = os.path.splitext(filename)[0] + '_defs.h'
cxx_proto_h_filename = cxx_fn_prefix + '_defs.h'
cxx_pyx_filename = cxx_fn_prefix + ".pyx"
cxx_pxd_filename = cxx_fn_prefix + ".pxd"
toplevel = ""
# for _ufuncs*
defs = []
defs_... | |
10,965 | [
-0.00933157280087471,
-0.0012559493770822883,
0.038769979029893875,
-0.03474162518978119,
-0.03415949270129204,
0.0014167632907629013,
-0.03697701171040535,
-0.010070879943668842,
0.04244904965162277,
0.03120226413011551,
0.010856757871806622,
-0.05183301493525505,
0.00933157280087471,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def main():
p = optparse.OptionParser(usage=__doc__.strip())
options, args = p.parse_args()
if len(args) != 0:
p.error('invalid number of arguments')
ufuncs = Ufunc.parse_all(UFUNCS)
generate("_ufuncs.pyx", "_ufuncs_cxx", ufuncs) | |
10,966 | [
-0.030717162415385246,
0.030507666990160942,
0.05294978991150856,
-0.04082528129220009,
-0.022036224603652954,
-0.023830024525523186,
-0.011116312816739082,
-0.02956494130194187,
-0.022494494915008545,
0.02676294930279255,
0.0094861825928092,
-0.020281707867980003,
-0.021028032526373863,
-... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fname", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def get_data(fname):
site_names = ['NUCROPS', 'NOUT', 'NPRE', 'NBEGYR', 'NENDYR', 'APDEP']
site_names = [item.lower() for item in site_names]
with open(fname, 'r') as f:
site_name = list(islice(f, 1))[0].strip().lower()
site_name = site_name[0].upper() + site_name[1:]
try:
... | |
10,967 | [
-0.007304976228624582,
0.05083788186311722,
0.06561412662267685,
-0.02367287315428257,
-0.015655217692255974,
-0.013980417512357235,
-0.0043057785369455814,
-0.034351203590631485,
-0.050220225006341934,
-0.0008017656509764493,
0.0009658306953497231,
-0.0020459871739149094,
-0.053593579679727... | 6 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":... | def main():
fname = 'noga.i'
site_params, crop_params = get_data(fname)
print(crop_params)
print(site_params) | |
10,968 | [
0.011997964233160019,
0.027220945805311203,
0.007831377908587456,
-0.051961109042167664,
-0.020511558279395103,
-0.030197883024811745,
0.034888818860054016,
0.004662742838263512,
-0.06310207396745682,
-0.02097388543188572,
0.009985147975385189,
0.015132770873606205,
-0.00513070821762085,
-... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class my_install(install_data):
def run(self):
# Generating and installing .mo files
check_call('po/update-mo.sh')
for langdir in glob('mo/*'):
lang = os.path.basename(langdir)
src = os.path.join(langdir, 'LC_MESSAGES', 'live-magic.mo')
dst = os.path.join(... | |
10,969 | [
0.013339090161025524,
0.030597839504480362,
0.023493457585573196,
-0.0533563606441021,
-0.024951081722974777,
-0.03209220990538597,
0.0407644547522068,
-0.004434114322066307,
-0.05913785845041275,
-0.02241555042564869,
-0.00036325748078525066,
0.02582075446844101,
-0.012353051453828812,
-0... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def run(self):
# Generating and installing .mo files
check_call('po/update-mo.sh')
for langdir in glob('mo/*'):
lang = os.path.basename(langdir)
src = os.path.join(langdir, 'LC_MESSAGES', 'live-magic.mo')
dst = os.path.join('share', 'locale', lang, 'LC_MESSAGE... | |
10,970 | [
0.0017155276145786047,
0.046071745455265045,
0.05136682838201523,
-0.0644913911819458,
-0.030503295361995697,
-0.009843423031270504,
-0.004811397287994623,
-0.04279060289263725,
-0.030752209946513176,
0.05525893718004227,
0.010776850394904613,
-0.012581477873027325,
0.012581477873027325,
0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "filename", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, filename=None, lines=None,
options=None, report=None, **kwargs):
if options is None:
options = StyleGuide(kwargs).options
else:
assert not kwargs
self._io_error = None
self._physical_checks = options.physical_checks
self... | |
10,971 | [
0.009098393842577934,
0.020830677822232246,
0.045639511197805405,
-0.03346460312604904,
-0.013617536053061485,
-0.014163986779749393,
0.01486344262957573,
-0.024393532425165176,
-0.026797913014888763,
0.07549754530191422,
0.021169476211071014,
-0.020000074058771133,
0.00850822776556015,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def __init__(self, *args, **kwargs):
# build options from the command line
self.checker_class = kwargs.pop('checker_class', Checker)
parse_argv = kwargs.pop('parse_argv', False)
config_file = kwargs.pop('config_file', None)
parser = kwargs.pop('parser', None)
# build opti... | |
10,972 | [
-0.02285686321556568,
0.011188946664333344,
0.019381549209356308,
-0.04780782386660576,
-0.03976559266448021,
0.024928683415055275,
-0.015694599598646164,
-0.00842094887048006,
0.007702495437115431,
0.039631929248571396,
0.020439738407731056,
0.00020589416089933366,
0.026666339486837387,
0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "prog", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "version", "annotation": null, "type_comment": null}}], "kwarg": n... | def get_parser(prog='pep8', version=__version__):
parser = OptionParser(prog=prog, version=version,
usage="%prog [options] input ...")
parser.config_options = [
'exclude', 'filename', 'select', 'ignore', 'max-line-length',
'hang-closing', 'count', 'format', 'quiet', 'sh... | |
10,973 | [
-0.027703434228897095,
0.026719171553850174,
0.040930986404418945,
0.032504722476005554,
-0.03922652825713158,
-0.048709072172641754,
0.009548562578856945,
-0.007333968300372362,
-0.02849564701318741,
0.010640855878591537,
-0.006595770362764597,
0.02083759196102619,
-0.0315924771130085,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "labels", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "xyzw", "annotation": null, "type_comment": null}}], "kwarg": nu... | def world_error(labels, xyzw):
xyzw = tf.transpose(xyzw, [0, 2, 1]) # [batch, 4, num_kp]
# [batch, 4, num_kp]
gt_world_coords = project(labels['to_world_L'], labels['keys_uvd_L'], True)
sub = xyzw[:, :3, :] - gt_world_coords[:, :3, :]
wd = tf.square(sub)
wd = tf.reduce_sum(wd, axis=[-2]) # [batch, num_kp]... | |
10,974 | [
-0.012666190974414349,
0.0190317090600729,
0.01876152493059635,
-0.0014846570556983352,
-0.045606933534145355,
-0.009132194332778454,
0.022695394232869148,
0.0234519075602293,
0.009083561599254608,
0.06964243948459625,
0.008575616404414177,
0.0073597920127213,
-0.021679503843188286,
0.0094... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "step", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "loss_step", "annotation": null, "type_comment": null}}, {"_type":... | def adjust_proj_factor(step, loss_step, minf=0.0):
if loss_step[1] == 0:
return 1.0
step = tf.cast(step, tf.float32)
return tf.maximum(
minf,
tf.minimum((step - loss_step[0]) /
tf.cast(loss_step[1] - loss_step[0], tf.float32), 1.0)) | |
10,975 | [
0.06530410051345825,
0.014375734142959118,
0.01848483830690384,
-0.008058751933276653,
-0.004498549737036228,
0.023268572986125946,
-0.02429891563951969,
0.0015424474840983748,
0.02306004986166954,
0.026102015748620033,
-0.008696583099663258,
-0.020496459677815437,
0.028604276478290558,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "sender", "annotation": null, "type_comment": null}}], "kwarg": {"... | def emit(self, sender=None, *args, **kwargs):
retval = None
if self._default_handler and self._flag is SIGNAL_RUN_FIRST:
retval = self._default_handler(sender, *args, **kwargs)
for cb, ckwargs in self._callbacks:
kw = dict(ckwargs if ckwargs else {})
kw.upd... | |
10,976 | [
0.04250336065888405,
0.038785796612501144,
-0.05143025144934654,
-0.003483736654743552,
0.003980990499258041,
0.07510900497436523,
-0.0391409806907177,
-0.03947248309850693,
-0.007879105396568775,
-0.012159040197730064,
-0.027183208614587784,
-0.039448801428079605,
0.03999341279268265,
-0.... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"keys": [], "values": []}}, "targets": [{"_type": "Name", "_fields": {"id": "__signals__", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"_ty... | class SignaledObject(object):
__signals__ = {}
_signal_prefix = 'do_'
def emit(self, name, *args, **kwargs):
if name not in self._decl_signals:
return []
else:
return self._decl_signals[name].emit(self, *args, **kwargs)
def connect(self, name, callback, **data):... | |
10,977 | [
0.03736235946416855,
0.050489675253629684,
-0.03169374540448189,
0.0017269763629883528,
0.005984174087643623,
0.026461180299520493,
-0.014733805321156979,
-0.024946488440036774,
-0.02083846554160118,
0.02827421762049198,
-0.02776932157576084,
-0.028388967737555504,
0.031533095985651016,
-0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "va... | def __new__(cls, *args, **kwargs):
self = object.__new__(cls)
signals = {}
# copy base __signals__ declarations
declared = {}
for base in reversed(cls.mro()):
if hasattr(base, '__signals__'):
declared.update(base.__signals__)
declared.update(se... | |
10,978 | [
0.026243820786476135,
0.04940779134631157,
0.06762664020061493,
0.014336501248180866,
0.07474067062139511,
0.044896453619003296,
0.03225170448422432,
-0.02459544874727726,
-0.032099880278110504,
-0.033509671688079834,
0.010025790892541409,
-0.05339858680963516,
0.020170871168375015,
-0.023... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "records"}}, {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "m... | class Record(Base):
__table__ = Table('records', Base.metadata,
Column('id', UUID(as_uuid=True), server_default=text('uuid_generate_v4()'), primary_key=True, unique=True),
Column('domain_id', ForeignKey('domains.id', onupdate='CASCADE', ondelete='CASCADE'), nullable=False, index=True),
... | |
10,979 | [
0.017629286274313927,
0.012374402955174446,
-0.03693109378218651,
-0.005421570502221584,
0.0007804632186889648,
0.04651419445872307,
-0.01119911763817072,
-0.012057979591190815,
-0.015956765040755272,
0.006938706152141094,
0.0037207964342087507,
-0.03620784357190132,
-0.016408797353506088,
... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "an... | class EntityNicsModule(BaseModule):
def __init__(self, *args, **kwargs):
super(EntityNicsModule, self).__init__(*args, **kwargs)
self.vnic_id = None
@property
def vnic_id(self):
return self._vnic_id
@vnic_id.setter
def vnic_id(self, vnic_id):
self._vnic_id = vnic_i... | |
10,980 | [
0.026455122977495193,
-0.006201869808137417,
-0.04318682849407196,
0.005958204157650471,
0.011289839632809162,
-0.013053514063358307,
-0.0026353595312684774,
-0.011632131412625313,
0.0020406993571668863,
-0.00974082201719284,
0.017335066571831703,
0.015768645331263542,
0.019528057426214218,
... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def build_entity(self):
return otypes.Nic(
id=self._module.params.get('id'),
name=self._module.params.get('name'),
interface=otypes.NicInterface(
self._module.params.get('interface')
) if self._module.params.get('interface') else None,
... | |
10,981 | [
-0.009187007322907448,
0.023308679461479187,
-0.02343052439391613,
0.010180032812058926,
-0.0000023143143152992707,
0.06004452332854271,
0.023503629490733147,
0.002621160354465246,
0.012525522150099277,
0.039550431072711945,
-0.023004071786999702,
-0.06160412356257439,
0.005208813585340977,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "entity", "annotation": null, "type_comment": null}}], "kwarg": nu... | def update_check(self, entity):
if self._module.params.get('vm'):
return (
equal(self._module.params.get('interface'), str(entity.interface)) and
equal(self._module.params.get('linked'), entity.linked) and
equal(self._module.params.get('name'), str(ent... | |
10,982 | [
0.007291113492101431,
0.03858834132552147,
-0.048979420214891434,
-0.03152042627334595,
-0.02936285175383091,
0.037844352424144745,
-0.0303796399384737,
0.014148232527077198,
0.023472921922802925,
0.045805055648088455,
0.0441930778324604,
-0.02262973226606846,
0.0524761788547039,
0.0015383... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def main():
argument_spec = ovirt_full_argument_spec(
state=dict(type='str', default='present', choices=['absent', 'plugged', 'present', 'unplugged']),
vm=dict(type='str'),
id=dict(default=None),
template=dict(type='str'),
name=dict(type='str', required=True),
interfa... | |
10,983 | [
0.021391594782471657,
0.004353320226073265,
0.04682672396302223,
-0.0009953939588740468,
-0.023009007796645164,
-0.01540455687791109,
0.00133045285474509,
0.01972200721502304,
0.03336567059159279,
-0.018743732944130898,
0.02362206019461155,
-0.013063221238553524,
0.0023364447988569736,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "client_info", "annotation": null, "type_comment": null}}], "kwarg... | def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
self.set_iam_policy: gapic_v1.method.wrap_method(
self.set_iam_policy,
default_timeout=30.0,
client_info=client_info,
),
... | |
10,984 | [
0.01595897786319256,
-0.004576815292239189,
0.04740961268544197,
-0.029698185622692108,
-0.007056531962007284,
-0.03649769350886345,
0.02602972462773323,
0.025211913511157036,
0.003595443209633231,
-0.002345362212508917,
0.017092229798436165,
0.0024578110314905643,
-0.0014720580074936152,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def setUp(self):
self.data = [x.split("|")[:-1]
for x in data.splitlines()]
self.posix_data = [x.split("|")[:-1]
for x in posix_data.splitlines()]
for item in self.data:
item[0] = item[0].replace(r"\n", "\n")
for item in self.po... | |
10,985 | [
0.03775130212306976,
-0.02429194003343582,
-0.01634185016155243,
-0.0049048797227442265,
0.023641055449843407,
0.015935048460960388,
-0.028011281043291092,
0.04121493920683861,
0.03954123705625534,
-0.002183659467846155,
0.012529526837170124,
-0.008996154181659222,
-0.010106144472956657,
0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testQuote(self):
safeunquoted = string.ascii_letters + string.digits + '@%_-+=:,./'
unicode_sample = '\xe9\xe0\xdf' # e + acute accent, a + grave, sharp s
unsafe = '"`$\\!' + unicode_sample
self.assertEqual(shlex.quote(''), "''")
self.assertEqual(shlex.quote(safeunquoted), ... | |
10,986 | [
0.01641729287803173,
0.0010446524247527122,
0.006413391791284084,
-0.04254133999347687,
-0.003547175321727991,
-0.0273126307874918,
-0.03449364751577377,
0.05447668954730034,
-0.004138370975852013,
0.005788148380815983,
0.0013595958007499576,
-0.06344058364629745,
0.008821508847177029,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "s", "annotation": null, "type_comment": null}}], "kwarg": null, "... | def oldSplit(self, s):
ret = []
lex = shlex.shlex(io.StringIO(s))
tok = lex.get_token()
while tok:
ret.append(tok)
tok = lex.get_token()
return ret | |
10,987 | [
-0.011294838041067123,
0.010855350643396378,
0.030789263546466827,
0.03952879458665848,
-0.040282201021909714,
0.0025082200299948454,
0.026745975017547607,
0.03425493836402893,
-0.00011448266741354018,
0.001787773915566504,
0.014754235744476318,
-0.0194504763931036,
-0.05660603567957878,
0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "form", "annotation": n... | class FloodProtectionMiddleware(PostingMiddleware):
def interrupt_posting(self, form):
now = timezone.now()
if self.user.last_posted_on:
previous_post = now - self.user.last_posted_on
if previous_post.total_seconds() < MIN_POSTING_PAUSE:
raise PostingInterrup... | |
10,988 | [
-0.019813915714621544,
-0.011641591787338257,
0.0035028608981519938,
0.02682574652135372,
-0.015233016572892666,
0.00967485923320055,
0.05379807949066162,
0.0231610257178545,
0.002931775525212288,
0.016039256006479263,
0.025213269516825676,
0.012264594435691833,
-0.030661486089229584,
0.00... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "form", "annotation": null, "type_comment": null}}], "kwarg": null... | def interrupt_posting(self, form):
now = timezone.now()
if self.user.last_posted_on:
previous_post = now - self.user.last_posted_on
if previous_post.total_seconds() < MIN_POSTING_PAUSE:
raise PostingInterrupt(_("You can't post message so "
... | |
10,989 | [
0.022238219156861305,
-0.01892254874110222,
0.03015781193971634,
-0.004297699313610792,
0.036936983466148376,
-0.0030754422768950462,
0.04832008108496666,
0.006525745149701834,
-0.009360959753394127,
-0.022681716829538345,
0.01444533932954073,
-0.026947736740112305,
0.02074933610856533,
-0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dialect", "annotation": null, "type_comment": null}}], "kwarg": n... | def bind_processor(self, dialect):
datetime_datetime = datetime.datetime
datetime_date = datetime.date
format = self._storage_format
def process(value):
if value is None:
return None
elif isinstance(value, datetime_datetime):
retur... | |
10,990 | [
0.009196490049362183,
0.04137662053108215,
0.03249864652752876,
-0.018544653430581093,
0.011153082363307476,
0.03357047215104103,
0.04327759891748428,
-0.019151348620653152,
-0.034925427287817,
0.050921957939863205,
0.01231591496616602,
-0.0002598994178697467,
-0.01231591496616602,
-0.0327... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def __init__(self, *args, **kwargs):
truncate_microseconds = kwargs.pop('truncate_microseconds', False)
super(DATETIME, self).__init__(*args, **kwargs)
if truncate_microseconds:
assert 'storage_format' not in kwargs, "You can specify only "\
"one of truncate_microseco... | |
10,991 | [
0.019328013062477112,
-0.01535044889897108,
0.024651072919368744,
-0.007159614469856024,
0.040011342614889145,
-0.00495722284540534,
0.033627599477767944,
0.000776484259404242,
-0.023413609713315964,
-0.03794890269637108,
0.007557370699942112,
-0.029797352850437164,
0.014859392307698727,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dialect", "annotation": null, "type_comment": null}}], "kwarg": n... | def bind_processor(self, dialect):
datetime_date = datetime.date
format = self._storage_format
def process(value):
if value is None:
return None
elif isinstance(value, datetime_date):
return format % {
'year': value.yea... | |
10,992 | [
0.017322571948170662,
-0.009893760085105896,
0.00838955957442522,
-0.035343870520591736,
0.029443521052598953,
-0.015740735456347466,
0.028298387303948402,
-0.002382460283115506,
0.008573945611715317,
0.018331842496991158,
0.01390658039599657,
-0.014741169288754463,
0.028764205053448677,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def process(value):
if value is None:
return None
elif isinstance(value, datetime_datetime):
return format % {
'year': value.year,
'month': value.month,
'day': value.day,
'hour': value... | |
10,993 | [
0.01871197298169136,
-0.006131783127784729,
0.009917880408465862,
-0.036086101084947586,
0.03778070583939552,
-0.02516929805278778,
0.024027671664953232,
-0.0035006909165531397,
-0.0056769163347780704,
0.0075320596806705,
0.015215741470456123,
-0.016063041985034943,
0.026917414739727974,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def process(value):
if value is None:
return None
elif isinstance(value, datetime_date):
return format % {
'year': value.year,
'month': value.month,
'day': value.day,
}
else:
... | |
10,994 | [
-0.0062987953424453735,
0.044139083474874496,
0.01892278529703617,
-0.025089586153626442,
0.023716839030385017,
0.01605057716369629,
0.05545896664261818,
0.004936608020216227,
-0.03602932021021843,
0.04641995579004288,
-0.0062090386636555195,
-0.006879572756588459,
-0.017993541434407234,
-... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def __init__(self, *args, **kwargs):
truncate_microseconds = kwargs.pop('truncate_microseconds', False)
super(TIME, self).__init__(*args, **kwargs)
if truncate_microseconds:
assert 'storage_format' not in kwargs, "You can specify only "\
"one of truncate_microseconds ... | |
10,995 | [
0.026959897950291634,
-0.011827895417809486,
0.009831241331994534,
-0.003331979736685753,
0.030041029676795006,
-0.009679211303591728,
0.04033849388360977,
0.0053565059788525105,
-0.011199505999684334,
-0.042892590165138245,
0.0069173420779407024,
-0.021993601694703102,
0.022703072056174278,... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dialect", "annotation": null, "type_comment": null}}], "kwarg": n... | def bind_processor(self, dialect):
datetime_time = datetime.time
format = self._storage_format
def process(value):
if value is None:
return None
elif isinstance(value, datetime_time):
return format % {
'hour': value.hou... | |
10,996 | [
0.022692762315273285,
-0.0022295776288956404,
-0.010358534753322601,
-0.035876352339982986,
0.015999412164092064,
-0.028601372614502907,
0.025610139593482018,
-0.009075257927179337,
0.015676286071538925,
-0.0024072977248579264,
0.01690416969358921,
-0.006185577716678381,
0.030743245035409927... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def process(value):
if value is None:
return None
elif isinstance(value, datetime_time):
return format % {
'hour': value.hour,
'minute': value.minute,
'second': value.second,
'microsec... | |
10,997 | [
0.051936712116003036,
-0.0011941330740228295,
0.03327709808945656,
-0.050902675837278366,
-0.009506063535809517,
0.04693104699254036,
0.009347433224320412,
-0.07750555127859116,
-0.045426998287439346,
0.02899995632469654,
0.00992907676845789,
-0.061854038387537,
0.06617818027734756,
0.0048... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "extract_map", "value": {"_type": "Attribute", "_fields": {"ctx": {"_typ... | class SQLiteCompiler(compiler.SQLCompiler):
extract_map = util.update_copy(
compiler.SQLCompiler.extract_map,
{
'month': '%m',
'day': '%d',
'year': '%Y',
'second': '%S',
'hour': '%H',
'doy': '%j',
'minute': '%M',
... | |
10,998 | [
0.006597783416509628,
0.02053374983370304,
-0.04060680419206619,
-0.03194138780236244,
0.003106936113908887,
0.018449662253260612,
-0.07090286165475845,
-0.026149816811084747,
-0.002783354138955474,
0.013491726480424404,
-0.0019743989687412977,
-0.03795233741402626,
0.056774940341711044,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "extract", "annotation": null, "type_comment": null}}], "kwarg": {... | def visit_extract(self, extract, **kw):
try:
return "CAST(STRFTIME('%s', %s) AS INTEGER)" % (
self.extract_map[extract.field],
self.process(extract.expr, **kw)
)
except KeyError:
raise exc.CompileError(
"%s is not a vali... | |
10,999 | [
0.05006545037031174,
0.022447342053055763,
0.060185059905052185,
-0.0003299345844425261,
-0.009703509509563446,
0.010408109985291958,
-0.009525972418487072,
-0.026497405022382736,
-0.037349358201026917,
0.05468141287565231,
0.0177204180508852,
-0.02587602660059929,
-0.024566689506173134,
0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "select", "annotation": null, "type_comment": null}}], "kwarg": {"... | def limit_clause(self, select, **kw):
text = ""
if select._limit_clause is not None:
text += "\n LIMIT " + self.process(select._limit_clause, **kw)
if select._offset_clause is not None:
if select._limit_clause is None:
text += "\n LIMIT " + self.process(sq... | |
11,000 | [
0.06540727615356445,
0.014416753314435482,
0.03995760530233383,
-0.0373842716217041,
-0.01697995699942112,
-0.013920322991907597,
0.028083795681595802,
-0.04850837215781212,
-0.023443687707185745,
0.005638034548610449,
-0.02307896316051483,
-0.038397397845983505,
0.026665421202778816,
0.00... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "column", "annotation": null, "type_comment": null}}], "kwarg": {"... | def get_column_specification(self, column, **kwargs):
coltype = self.dialect.type_compiler.process(
column.type, type_expression=column)
colspec = self.preparer.format_column(column) + " " + coltype
default = self.get_column_default_string(column)
if default is not None:
... |