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 |
|---|---|---|---|---|---|
20,201 | [
-0.008106047287583351,
-0.03869457542896271,
0.03547779843211174,
-0.02841487154364586,
0.03834492713212967,
0.004568757023662329,
0.015629345551133156,
-0.002513107843697071,
0.00009642685472499579,
-0.009172478690743446,
0.011969677172601223,
-0.016212094575166702,
-0.018006963655352592,
... | 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 testFeedMismatchedSizes(self):
with self.test_session(use_gpu=False) as sess:
sp_input = self._SparseTensorPlaceholder()
input_val = self._SparseTensorValue_5x6()
sp_output = tf.sparse_reshape(sp_input, [4, 7])
with self.assertRaisesOpError(
"Input to reshape is a tensor with 3... | |
20,202 | [
0.006731611210852861,
-0.04671388864517212,
0.052688922733068466,
-0.0062854234129190445,
0.026344461366534233,
0.013838278129696846,
0.010870161466300488,
0.03910930082201958,
0.0023877497296780348,
0.04785199090838432,
0.009150076657533646,
0.009699727408587933,
0.015441966243088245,
0.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 testFeedPartialShapes(self):
with self.test_session(use_gpu=False):
# Incorporate new rank into shape information if known
sp_input = self._SparseTensorPlaceholder()
sp_output = tf.sparse_reshape(sp_input, [2, 3, 5])
self.assertListEqual(sp_output.indices.get_shape().as_list(), [None, 3]... | |
20,203 | [
0.002080181147903204,
-0.019269047304987907,
0.034645356237888336,
-0.002417754614725709,
0.03892736881971359,
0.026786895468831062,
0.008758657611906528,
0.028343990445137024,
0.0179795790463686,
0.02372136525809765,
0.009707512333989143,
0.004020467400550842,
-0.014317972585558891,
0.036... | 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 testFeedDenseReshapeSemantics(self):
with self.test_session(use_gpu=False) as sess:
# Compute a random rank-5 initial shape and new shape, randomly sparsify
# it, and check that the output of SparseReshape has the same semantics
# as a dense reshape.
factors = np.array([2] * 4 + [3] * 4 ... | |
20,204 | [
0.002597765065729618,
-0.03596579283475876,
0.040279749780893326,
-0.054869644343853,
-0.02590797282755375,
-0.02395699918270111,
0.01595921441912651,
0.0030688466504216194,
0.044060517102479935,
0.02182425558567047,
-0.016783228144049644,
0.01371741108596325,
0.02098812349140644,
-0.04910... | 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": "testnet_prototxt_path", "annotation": null, "type_comment": null}... | def __init__(self, testnet_prototxt_path="testnet.prototxt",
trainnet_prototxt_path="trainnet.prototxt", debug=False):
self.sp = {}
# critical:
self.sp['base_lr'] = '0.001'
self.sp['momentum'] = '0.9'
# speed:
self.sp['test_iter'] = '100'
self.... | |
20,205 | [
0.009876908734440804,
-0.006473740562796593,
0.04290486499667168,
-0.008285200223326683,
-0.013897755183279514,
0.004807791672646999,
-0.004608828108757734,
0.01873227395117283,
-0.01452731154859066,
0.06067498400807381,
0.02383999526500702,
-0.03525516018271446,
0.025087229907512665,
-0.0... | 6 | {"_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 __init__(self):
self.entry = None
self.exit = None
self.nodes = list()
self.rpo = []
self.edges = defaultdict(list)
self.catch_edges = defaultdict(list)
self.reverse_edges = defaultdict(list)
self.reverse_catch_edges = defaultdict(list)
self.lo... | |
20,206 | [
0.04729514196515083,
-0.008474655449390411,
0.0329255647957325,
-0.00936851091682911,
-0.019981632009148598,
0.03969171270728111,
-0.01645146869122982,
0.02002689056098461,
-0.008497284725308418,
0.065851129591465,
0.04824557155370712,
-0.029780099168419838,
-0.002674494870007038,
-0.03412... | 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": "node", "annotation": null, "type_comment": null}}], "kwarg": null... | def remove_node(self, node):
preds = self.reverse_edges.get(node, [])
for pred in preds:
self.edges[pred].remove(node)
succs = self.edges.get(node, [])
for suc in succs:
self.reverse_edges[suc].remove(node)
exc_preds = self.reverse_catch_edges.pop(node, ... | |
20,207 | [
-0.00958381686359644,
0.025504041463136673,
0.03428449109196663,
-0.019665494561195374,
-0.0307542085647583,
-0.016757536679506302,
0.014981078915297985,
0.016587810590863228,
-0.009351858869194984,
0.012288105674088001,
-0.020446229726076126,
0.03136521950364113,
0.007326471619307995,
-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 number_ins(self):
self.loc_to_ins = {}
self.loc_to_node = {}
num = 0
for node in self.rpo:
start_node = num
num = node.number_ins(num)
end_node = num - 1
self.loc_to_ins.update(node.get_loc_with_ins())
self.loc_to_node[start... | |
20,208 | [
0.02256503887474537,
-0.012025964446365833,
0.02578861638903618,
-0.013905392959713936,
-0.009700468741357327,
0.02197028324007988,
-0.0012460136786103249,
0.02109004370868206,
-0.03309221938252449,
0.017890257760882378,
0.03371076658368111,
0.0029247121419757605,
0.0020251439418643713,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "n", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cnt", "annotation": null, "type_comment": null}}], "kwarg": null, "v... | def _visit(n, cnt):
visited.add(n)
for suc in self.all_sucs(n):
if not suc in visited:
for cnt, s in _visit(suc, cnt):
yield cnt, s
n.po = cnt
yield cnt + 1, n | |
20,209 | [
0.008547259494662285,
0.004519786220043898,
0.01182736735790968,
-0.017248738557100296,
-0.0840371772646904,
-0.01854179985821247,
-0.0316503643989563,
0.019467109814286232,
-0.011435889638960361,
0.08085791021585464,
-0.010279251262545586,
-0.016845397651195526,
-0.0058454712852835655,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "start", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def bfs(start):
to_visit = [start]
visited = set([start])
while to_visit:
node = to_visit.pop(0)
yield node
if node.exception_analysis:
for _, _, exception in node.exception_analysis.exceptions:
if exception not in visited:
to_visit.app... | |
20,210 | [
0.009096229448914528,
-0.02597370184957981,
0.020485535264015198,
-0.04116668552160263,
0.012802100740373135,
0.03475476801395416,
-0.006612969562411308,
-0.012726027518510818,
-0.03245082497596741,
0.04881751909852028,
0.012595615349709988,
-0.003135319333523512,
-0.03158141300082207,
-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": "n", "annotation": null, "type_comment": null}}], "kwarg": null, "var... | def _dfs(v, n):
semi[v] = n = n + 1
vertex[n] = label[v] = v
ancestor[v] = 0
for w in graph.all_sucs(v):
if not semi[w]:
parent[w] = v
n = _dfs(w, n)
pred[w].add(v)
return n | |
20,211 | [
-0.0018130840035155416,
0.0014908425509929657,
0.05289939045906067,
-0.027327289804816246,
-0.05426453799009323,
-0.014699692837893963,
-0.009915588423609734,
-0.004470242187380791,
0.006795255932956934,
0.03612760454416275,
0.003936982247978449,
-0.028668057173490524,
-0.009428036399185658,... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "start_block", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "vmap", "annotation": null, "type_comment": null}}, {"_type... | def construct(start_block, vmap, exceptions):
bfs_blocks = bfs(start_block)
graph = Graph()
gen_ret = GenInvokeRetName()
# Construction of a mapping of basic blocks into Nodes
block_to_node = {}
exceptions_start_block = []
for exception in exceptions:
for _, _, block in exception.... | |
20,212 | [
-0.0005523573490791023,
-0.007060079835355282,
-0.029070258140563965,
-0.018382003530859947,
-0.0390743725001812,
-0.018067972734570503,
0.015051036141812801,
-0.043246492743492126,
0.010688254609704018,
0.030640410259366035,
0.05266740918159485,
0.03429662436246872,
-0.0041665127500891685,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "graph", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "block", "annotation": null, "type_comment": null}}, {"_type": "a... | def make_node(graph, block, block_to_node, vmap, gen_ret):
node = block_to_node.get(block)
if node is None:
node = build_node_from_block(block, vmap, gen_ret)
block_to_node[block] = node
if block.exception_analysis:
for _type, _, exception_target in block.exception_analysis.exception... | |
20,213 | [
0.03079567663371563,
0.045406125485897064,
-0.021521978080272675,
-0.013473108410835266,
-0.016119612380862236,
-0.042694006115198135,
-0.028783459216356277,
0.058573026210069656,
0.0019479687325656414,
0.03558563068509102,
0.014522961340844631,
-0.07143372297286987,
-0.03068631701171398,
... | 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": "posts", "annotation": null, "type_comment": null}}], "kwarg": nul... | def search(self, posts):
q = self.search_term()
if q:
posts = posts.filter(
Q(title__icontains=q) |
Q(teaser_html__icontains=q) |
Q(content_html__icontains=q)
)
return posts | |
20,214 | [
0.011006416752934456,
-0.00847176555544138,
-0.023642629384994507,
-0.036638665944337845,
0.007434622850269079,
-0.02914583683013916,
-0.06248258054256439,
-0.01554656308144331,
-0.018636826425790787,
0.025738080963492393,
-0.009614739567041397,
-0.03835313022136688,
0.008106648921966553,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "Post", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields": {}}}}], "type_... | class BlogIndexView(ListView):
model = Post
template_name = "pinax/blog/blog_list.html"
search_parameter = "q"
paginate_by = 10
def get_current_section(self):
return "all"
def get_context_data(self, **kwargs):
context = super(BlogIndexView, self).get_context_data(**kwargs)
... | |
20,215 | [
0.027550868690013885,
-0.025723515078425407,
-0.039820242673158646,
-0.060603879392147064,
0.04357535392045975,
0.05787288770079613,
-0.028454504907131195,
0.033113252371549606,
-0.013474222272634506,
-0.014568625949323177,
-0.016536545008420944,
-0.008875717408955097,
0.0015926590422168374,... | 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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class SectionIndexView(BlogIndexView):
def get_current_section(self):
return Section.objects.get(slug__iexact=self.kwargs.get("section"))
def get_queryset(self):
queryset = super(SectionIndexView, self).get_queryset()
queryset = queryset.filter(section__slug__iexact=self.kwargs.get("se... | |
20,216 | [
0.010820738971233368,
-0.018918514251708984,
-0.062181152403354645,
0.02038159966468811,
0.008138415403664112,
-0.05319942906498909,
-0.011979015544056892,
-0.019060757011175156,
0.0015532587422057986,
0.013370979577302933,
0.004818531218916178,
-0.027168693020939827,
-0.008834397420287132,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "Post", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields": {}}}}], "type_... | class SlugUniquePostDetailView(DetailView):
model = Post
template_name = "pinax/blog/blog_post.html"
slug_url_kwarg = "post_slug"
def get(self, request, *args, **kwargs):
if not settings.PINAX_BLOG_SLUG_UNIQUE:
raise Http404()
self.object = self.get_object()
context ... | |
20,217 | [
-0.010679666884243488,
-0.0051087187603116035,
-0.018725696951150894,
-0.011899740435183048,
-0.018295716494321823,
-0.014662371948361397,
-0.021488329395651817,
-0.012480215169489384,
0.0037515892181545496,
0.030485693365335464,
0.0067829592153429985,
-0.020209133625030518,
-0.0065679685212... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "Post", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields": {}}}}], "type_... | class DateBasedPostDetailView(DateDetailView):
model = Post
month_format = "%m"
date_field = "published"
template_name = "pinax/blog/blog_post.html"
def get(self, request, *args, **kwargs):
self.object = self.get_object()
if settings.PINAX_BLOG_SLUG_UNIQUE:
post_redirect... | |
20,218 | [
0.002726102713495493,
-0.031625933945178986,
-0.05219033360481262,
-0.005166239570826292,
0.01854064129292965,
-0.019885623827576637,
-0.01710766926407814,
-0.009898817166686058,
0.0057538836263120174,
-0.024850744754076004,
0.008428135886788368,
-0.01629062369465828,
0.014178876765072346,
... | 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": {... | def get(self, request, *args, **kwargs):
self.object = self.get_object()
if settings.PINAX_BLOG_SLUG_UNIQUE:
post_redirected.send(sender=self.object, post=self.object, request=request)
return redirect(self.object.get_absolute_url(), permanent=True)
context = self.get_cont... | |
20,219 | [
0.008930740877985954,
-0.012522619217634201,
-0.012605072930455208,
-0.013666661456227303,
0.004207703284919262,
-0.018634481355547905,
-0.012512312270700932,
0.01648038625717163,
-0.00666327029466629,
-0.006307689938694239,
-0.009811962023377419,
-0.037124671041965485,
-0.008276266045868397... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "Post", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields": {}}}}], "type_... | class SecretKeyPostDetailView(DetailView):
model = Post
slug_url_kwarg = "post_secret_key"
slug_field = "secret_key"
template_name = "pinax/blog/blog_post.html"
def get(self, request, *args, **kwargs):
self.object = self.get_object()
if self.object.is_published:
return r... | |
20,220 | [
0.0021715578623116016,
-0.004710773006081581,
-0.038447946310043335,
0.01041078194975853,
0.008337089791893959,
-0.046721555292606354,
-0.012315193191170692,
-0.006385067943483591,
0.004626132547855377,
0.016208656132221222,
0.01930861361324787,
-0.0404369980096817,
0.014198443852365017,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "Post", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields": {}}}}], "type_... | class StaffPostDetailView(DetailView):
model = Post
template_name = "pinax/blog/blog_post.html"
pk_url_kwarg = "post_pk"
def get(self, request, *args, **kwargs):
if not request.user.is_authenticated() and not request.user.is_staff:
raise Http404()
self.object = self.get_obje... | |
20,221 | [
0.0401085801422596,
0.003073910716921091,
-0.0524614118039608,
-0.023580946028232574,
0.04434056580066681,
-0.0033860676921904087,
-0.04312053322792053,
-0.022437166422605515,
0.009598227217793465,
-0.0033979821018874645,
0.007310665212571621,
-0.02565881423652172,
0.015288536436855793,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def serialize_request(request):
data = {
"path": request.path,
"META": {
"QUERY_STRING": request.META.get("QUERY_STRING"),
"REMOTE_ADDR": request.META.get("REMOTE_ADDR"),
}
}
for key in request.META:
if key.startswith("HTTP"):
data["META"][... | |
20,222 | [
0.029342899098992348,
-0.027652539312839508,
-0.016686877235770226,
-0.047200024127960205,
0.038228120654821396,
-0.02526869997382164,
-0.01081396359950304,
-0.00498439185321331,
-0.007178607862442732,
0.02103196643292904,
0.009080261923372746,
-0.05214107409119606,
-0.009714147076010704,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "section", "annotation": null, "type_comment": null}}, {"_type"... | def blog_feed(request, section=None, feed_type=None):
posts = Post.objects.published().order_by("-updated")
if section and section != "all":
section = get_object_or_404(Section, slug=section)
feed_title = settings.PINAX_BLOG_SECTION_FEED_TITLE % section.name
posts = posts.filter(section... | |
20,223 | [
-0.024140585213899612,
-0.0839443951845169,
-0.0003871228836942464,
-0.041818853467702866,
0.01653914898633957,
0.028215130791068077,
-0.010783306322991848,
-0.020986098796129227,
0.0363423153758049,
-0.029770467430353165,
0.019649824127554893,
-0.027295071631669998,
0.010542338714003563,
... | 9 | {"_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 test_connection_utils(unittest.TestCase):
def setUp(self):
self.url = "amqp://user:pass@localhost:5672/my/vhost"
self.nopass = "amqp://user@localhost:5672/my/vhost"
self.expected = {
"transport": "amqp",
"userid": "user",
"password": "pass",
... | |
20,224 | [
-0.015389473177492619,
-0.06766040623188019,
-0.013936493545770645,
0.004431587178260088,
0.03477463871240616,
0.012568271718919277,
0.018477054312825203,
-0.0069985175505280495,
0.03969055414199829,
-0.010255612432956696,
0.004331694915890694,
-0.019251976162195206,
0.048142049461603165,
... | 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 test_parse_generated_as_uri(self):
conn = BrokerConnection(self.url)
info = conn.info()
for k, v in self.expected.items():
self.assertEqual(info[k], v)
# by default almost the same- no password
self.assertEqual(conn.as_uri(), self.nopass)
self.assertEqual(... | |
20,225 | [
0.010336448438465595,
-0.047298844903707504,
0.013917580246925354,
-0.011051512323319912,
0.012033998034894466,
0.04267127811908722,
0.0016161601524800062,
-0.003377658547833562,
0.029369931668043137,
0.021358894184231758,
0.03160232678055763,
-0.012301420792937279,
0.03381146490573883,
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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class test_Connection(unittest.TestCase):
def setUp(self):
self.conn = BrokerConnection(port=5672, transport=Transport)
def test_establish_connection(self):
conn = self.conn
conn.connect()
self.assertTrue(conn.connection.connected)
self.assertEqual(conn.host, "localhost... | |
20,226 | [
0.019573649391531944,
-0.036069270223379135,
0.0227167047560215,
-0.03355482593178749,
0.042333703488111496,
0.022023065015673637,
0.013547652401030064,
0.014978284947574139,
0.0025374754332005978,
0.014143749140202999,
0.007304894272238016,
0.03296956792473793,
0.02210976928472519,
0.0275... | 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 test_establish_connection(self):
conn = self.conn
conn.connect()
self.assertTrue(conn.connection.connected)
self.assertEqual(conn.host, "localhost:5672")
channel = conn.channel()
self.assertTrue(channel.open)
self.assertEqual(conn.drain_events(), "event")
... | |
20,227 | [
0.024888424202799797,
-0.0073694451712071896,
0.01797129586338997,
0.0042501175776124,
0.005940787494182587,
0.02236207388341427,
0.01922895573079586,
0.01920689083635807,
0.022659940645098686,
0.0036185297649353743,
0.010916266590356827,
-0.032434385269880295,
0.022704068571329117,
0.0998... | 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 test_close_survives_connerror(self):
class _CustomError(Exception):
pass
class MyTransport(Transport):
connection_errors = (_CustomError, )
def close_connection(self, connection):
raise _CustomError("foo")
conn = BrokerConnection(transp... | |
20,228 | [
0.029275652021169662,
-0.023410947993397713,
0.03193272277712822,
-0.013309290632605553,
0.032985977828502655,
0.018731150776147842,
0.020969314500689507,
0.02791121043264866,
0.04256100580096245,
0.032411474734544754,
0.015224296599626541,
-0.009096277877688408,
0.022453444078564644,
0.03... | 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 test__enter____exit__(self):
conn = self.conn
context = conn.__enter__()
self.assertIs(context, conn)
conn.connect()
self.assertTrue(conn.connection.connected)
conn.__exit__()
self.assertIsNone(conn.connection)
conn.close() | |
20,229 | [
0.023071495816111565,
-0.011438627727329731,
0.03839493915438652,
-0.0037715097423642874,
0.004200458060950041,
0.011427836492657661,
0.007942291907966137,
-0.012075305916368961,
-0.029718849807977676,
0.008427894674241543,
0.028747644275426865,
-0.010607708245515823,
0.015431355684995651,
... | 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 test_ensure_connection_failure(self):
class _ConnectionError(Exception):
pass
def publish():
raise _ConnectionError("failed connection")
self.conn.transport.connection_errors = (_ConnectionError,)
ensured = self.conn.ensure(self.conn, publish)
self.a... | |
20,230 | [
0.03534277528524399,
-0.016782190650701523,
0.03727874904870987,
0.011210639029741287,
-0.0092521533370018,
-0.004901840351521969,
0.00856555812060833,
-0.011131849139928818,
-0.0008441745885647833,
-0.0000968162712524645,
0.003202235559001565,
-0.013326702639460564,
0.0175025537610054,
0.... | 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 test_ensure_failure(self):
class _CustomError(Exception):
pass
def publish():
raise _CustomError("bar")
ensured = self.conn.ensure(None, publish)
self.assertRaises(_CustomError, ensured) | |
20,231 | [
0.006962832063436508,
-0.03960419446229935,
-0.013777518644928932,
-0.030271034687757492,
0.05338171124458313,
0.030666090548038483,
0.008351694792509079,
0.015012063086032867,
-0.0033517887350171804,
-0.013024446554481983,
0.03113521635532379,
0.003191298106685281,
0.0023533508647233248,
... | 7 | {"_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 test_SimpleQueue(self):
conn = self.conn
q = conn.SimpleQueue("foo")
self.assertTrue(q.channel)
self.assertTrue(q.channel_autoclose)
chan = conn.channel()
q2 = conn.SimpleQueue("foo", channel=chan)
self.assertIs(q2.channel, chan)
self.assertFalse(q2.ch... | |
20,232 | [
0.009515952318906784,
-0.05879654362797737,
-0.009609063155949116,
-0.0069709159433841705,
0.02059617079794407,
0.02552485093474388,
0.018075963482260704,
0.012706559151411057,
0.008932456374168396,
-0.006443286780267954,
0.054178234189748764,
0.01656135730445385,
0.018647044897079468,
0.0... | 7 | {"_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 test_SimpleBuffer(self):
conn = self.conn
q = conn.SimpleBuffer("foo")
self.assertTrue(q.channel)
self.assertTrue(q.channel_autoclose)
chan = conn.channel()
q2 = conn.SimpleBuffer("foo", channel=chan)
self.assertIs(q2.channel, chan)
self.assertFalse(q2... | |
20,233 | [
-0.002649341244250536,
0.03358887881040573,
0.06214187294244766,
0.0011657712748274207,
0.022270357236266136,
0.013750906102359295,
-0.019886866211891174,
0.018016742542386055,
0.03219545632600784,
-0.014838756062090397,
0.049014341086149216,
-0.009662303142249584,
-0.006563765928149223,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": true}}, "targets": [{"_type": "Name", "_fields": {"id": "abstract", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {... | class ResourceCase(unittest.TestCase):
abstract = True
def create_resource(self, limit, preload):
raise NotImplementedError("subclass responsibility")
def assertState(self, P, avail, dirty):
self.assertEqual(P._resource.qsize(), avail)
self.assertEqual(len(P._dirty), dirty)
de... | |
20,234 | [
0.012766738422214985,
0.03774513676762581,
0.07683278620243073,
-0.0023397081531584263,
0.01821422390639782,
0.031161684542894363,
0.010204354301095009,
0.02501712739467621,
0.01480631809681654,
-0.014289968647062778,
0.0722372755408287,
0.008255135267972946,
-0.0053797150030732155,
0.0116... | 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 test_acquire__release(self):
if self.abstract:
return
P = self.create_resource(10, 0)
self.assertState(P, 10, 0)
chans = [P.acquire() for _ in xrange(10)]
self.assertState(P, 0, 10)
self.assertRaises(P.LimitExceeded, P.acquire)
chans.pop().release(... | |
20,235 | [
-0.011946761049330235,
-0.029439406469464302,
0.04531450197100639,
-0.0004870702396146953,
0.027775641530752182,
0.006903471425175667,
-0.0036857028026133776,
0.020658422261476517,
0.023003868758678436,
-0.028422661125659943,
0.03621000796556473,
-0.007215427700430155,
0.034661781042814255,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": false}}, "targets": [{"_type": "Name", "_fields": {"id": "abstract", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, ... | class test_ConnectionPool(ResourceCase):
abstract = False
def create_resource(self, limit, preload):
return BrokerConnection(port=5672, transport=Transport) \
.Pool(limit, preload)
def test_setup(self):
P = self.create_resource(10, 2)
q = P._resource.queue
... | |
20,236 | [
-0.014623918570578098,
0.004847691394388676,
0.02790641412138939,
0.0037817382253706455,
0.06041199713945389,
0.008719257079064846,
-0.0059645469300448895,
0.026014046743512154,
0.030229952186346054,
-0.01663605496287346,
0.052411358803510666,
0.0013870864640921354,
0.005584276746958494,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": false}}, "targets": [{"_type": "Name", "_fields": {"id": "abstract", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, ... | class test_ChannelPool(ResourceCase):
abstract = False
def create_resource(self, limit, preload):
return BrokerConnection(port=5672, transport=Transport) \
.ChannelPool(limit, preload)
def test_setup(self):
P = self.create_resource(10, 2)
q = P._resource.queue
... | |
20,237 | [
0.01890179142355919,
0.012071345001459122,
-0.0015737094217911363,
0.0032827607356011868,
-0.028035927563905716,
-0.01710491068661213,
0.04257222265005112,
-0.009139897301793098,
-0.037227656692266464,
0.012324750423431396,
-0.007510034833103418,
-0.01194464135915041,
-0.0029026516713202,
... | 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": "image_reader", "annotation": null, "type_comment": null}}], "kwar... | def __init__(self, image_reader):
super(ImageReaderUI, self).__init__()
self.image_reader = image_reader
self._ui_view = None
self.show_config_ui_trigger.connect(self._actualShowConfigUI)
self.default_width = 120
self.default_depth = 120
self._aspect = 1
... | |
20,238 | [
0.0013206915464252234,
0.013503381982445717,
-0.025957956910133362,
-0.02724512852728367,
-0.029295068234205246,
0.01390860229730606,
0.0036112309899181128,
-0.007264175917953253,
-0.018342193216085434,
-0.003068950492888689,
-0.0016417395090684295,
0.0002314748417120427,
0.02424172870814800... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Name", "_fields": {"id": "pyqtSignal", "ctx": {"_type": "Load", "_fields": {}}}}, "keywords": []}}, "targets": [{"_type": "Name", "_fi... | class ImageReaderUI(QObject):
show_config_ui_trigger = pyqtSignal()
def __init__(self, image_reader):
super(ImageReaderUI, self).__init__()
self.image_reader = image_reader
self._ui_view = None
self.show_config_ui_trigger.connect(self._actualShowConfigUI)
self.default_w... | |
20,239 | [
0.012005970813333988,
0.041737791150808334,
-0.007510954048484564,
-0.015137461014091969,
-0.02886517345905304,
-0.015969444066286087,
0.026554111391305923,
-0.0137392682954669,
-0.05167536064982414,
0.002257619285956025,
-0.005240334663540125,
0.0013086393009871244,
0.04252355545759201,
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 _createConfigUI(self):
if self._ui_view is None:
Logger.log("d", "Creating ImageReader config UI")
path = QUrl.fromLocalFile(os.path.join(PluginRegistry.getInstance().getPluginPath("ImageReader"), "ConfigUI.qml"))
component = QQmlComponent(Application.getInstance()._engin... | |
20,240 | [
0.04184834659099579,
0.026422208175063133,
0.029217371717095375,
0.025130104273557663,
-0.05426836758852005,
0.02916463278234005,
0.014951488934457302,
-0.043114081025123596,
-0.006763768848031759,
0.02298099175095558,
-0.013369320891797543,
-0.02532787434756756,
-0.0059726848267018795,
0.... | 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 _actualShowConfigUI(self):
self._disable_size_callbacks = True
if self._ui_view is None:
self._createConfigUI()
self._ui_view.show()
self._ui_view.findChild(QObject, "Width").setProperty("text", str(self._width))
self._ui_view.findChild(QObject, "Depth").setProp... | |
20,241 | [
0.04162038117647171,
0.017135076224803925,
0.010625369846820831,
0.04590994492173195,
-0.012022376991808414,
0.004593892954289913,
-0.001973779872059822,
-0.012984630651772022,
-0.019952276721596718,
0.02671124041080475,
-0.002547654090449214,
0.0185030996799469,
-0.019662441685795784,
0.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": "value", "annotation": null, "type_comment": null}}], "kwarg": nul... | def onWidthChanged(self, value):
if self._ui_view and not self._disable_size_callbacks:
if len(value) > 0:
self._width = float(value)
else:
self._width = 0
self._depth = self._width / self._aspect
self._disable_size_callbacks = Tru... | |
20,242 | [
0.04532124102115631,
0.020814199000597,
0.023032302036881447,
0.040573302656412125,
-0.018979767337441444,
0.009867561049759388,
0.0018509170040488243,
-0.023044291883707047,
-0.025202445685863495,
0.01668972708284855,
0.00027707553817890584,
0.027984067797660828,
-0.014879275113344193,
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": "value", "annotation": null, "type_comment": null}}], "kwarg": nul... | def onDepthChanged(self, value):
if self._ui_view and not self._disable_size_callbacks:
if len(value) > 0:
self._depth = float(value)
else:
self._depth = 0
self._width = self._depth * self._aspect
self._disable_size_callbacks = Tru... | |
20,243 | [
0.022909419611096382,
0.0001313788234256208,
0.002218117006123066,
0.03172966092824936,
-0.01904476061463356,
-0.014866750687360764,
0.013276786543428898,
-0.009667450562119484,
-0.004027137067168951,
-0.0007529121357947588,
0.006644195877015591,
-0.03270453214645386,
0.03644152730703354,
... | 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 startElement(self, name, attrs, connection):
result = super(InternetGateway, self).startElement(name, attrs, connection)
if result is not None:
# Parent found an interested element, just return it
return result
if name == 'attachmentSet':
self.attachment... | |
20,244 | [
0.019010648131370544,
-0.0353928878903389,
-0.007460376713424921,
0.018682098016142845,
-0.03011341206729412,
0.0034639486111700535,
0.004622374661266804,
0.004350470378994942,
-0.0029116428922861814,
0.0012150726979598403,
0.006044208072125912,
-0.05116334185004234,
0.05061953514814377,
-... | 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": "connection", "annotati... | class InternetGateway(TaggedEC2Object):
def __init__(self, connection=None):
TaggedEC2Object.__init__(self, connection)
self.id = None
self.attachments = []
def __repr__(self):
return 'InternetGateway:%s' % self.id
def startElement(self, name, attrs, connection):
re... | |
20,245 | [
0.01631840690970421,
0.009805464185774326,
-0.016426555812358856,
-0.04059173911809921,
0.0197190772742033,
-0.015429186634719372,
0.012130657210946083,
-0.006603066809475422,
0.04890715703368187,
0.010622586123645306,
0.06887857615947723,
-0.043812159448862076,
-0.006506934762001038,
-0.0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_webfilter_content_creation(mocker):
schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')
set_method_result = {'status': 'success', 'http_method': 'POST', 'http_status': 200}
set_method_mock = mocker.patch('ansible.module_utils.network.fortios.fort... | |
20,246 | [
0.010000222362577915,
-0.03788219764828682,
-0.0014115780359134078,
0.040149200707674026,
-0.02184370718896389,
-0.022648809477686882,
0.0026245287153869867,
0.0014526277082040906,
0.0014618969289585948,
0.023305604234337807,
0.004552537575364113,
-0.048645149916410446,
0.08360355347394943,
... | 9 | {"_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": "connection", "annotati... | class InternetGatewayAttachment(object):
def __init__(self, connection=None):
self.vpc_id = None
self.state = None
def __repr__(self):
return 'InternetGatewayAttachment:%s' % self.vpc_id
def startElement(self, name, attrs, connection):
return None
def endElement(self, ... | |
20,247 | [
0.006600312422960997,
0.022514330223202705,
-0.03986265882849693,
-0.03203914687037468,
0.010071219876408577,
0.020192112773656845,
-0.010791479609906673,
0.006109790410846472,
0.053348902612924576,
0.01633002981543541,
0.07182729244232178,
-0.05563386529684067,
-0.013660101220011711,
-0.0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_webfilter_content_removal(mocker):
schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')
delete_method_result = {'status': 'success', 'http_method': 'POST', 'http_status': 200}
delete_method_mock = mocker.patch('ansible.module_utils.network.fortios... | |
20,248 | [
0.0124439038336277,
0.015674075111746788,
-0.0009364216821268201,
-0.04431650787591934,
0.011013570241630077,
-0.009875263087451458,
0.021443087607622147,
-0.00849856622517109,
0.04991865158081055,
0.011120845563709736,
0.06279165297746658,
-0.0516827292740345,
-0.012527340091764927,
-0.03... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_webfilter_content_creation_fails(mocker):
schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')
set_method_result = {'status': 'error', 'http_method': 'POST', 'http_status': 500}
set_method_mock = mocker.patch('ansible.module_utils.network.fortios.... | |
20,249 | [
0.017544612288475037,
0.03321779891848564,
-0.019686901941895485,
-0.041565340012311935,
0.009443311020731926,
0.021976934745907784,
0.009917322546243668,
0.01635034754872322,
0.05407434329390526,
0.006888568866997957,
0.07318258285522461,
-0.05973786488175392,
-0.025510482490062714,
-0.02... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_webfilter_content_deletion_fails(mocker):
schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')
delete_method_result = {'status': 'error', 'http_method': 'POST', 'http_status': 500}
delete_method_mock = mocker.patch('ansible.module_utils.network.fo... | |
20,250 | [
0.014338006265461445,
-0.0029098461382091045,
-0.026734013110399246,
-0.014993746764957905,
0.019445212557911873,
0.011431313119828701,
0.002827878575772047,
-0.010094611905515194,
0.05437597632408142,
-0.00016787573986221105,
0.07041638344526291,
-0.06663326919078827,
-0.008953372947871685,... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_webfilter_content_idempotent(mocker):
schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')
set_method_result = {'status': 'error', 'http_method': 'DELETE', 'http_status': 404}
set_method_mock = mocker.patch('ansible.module_utils.network.fortios.fo... | |
20,251 | [
-0.004622458014637232,
0.010480041615664959,
-0.01750173047184944,
-0.03334839269518852,
0.021762914955615997,
0.008411205373704433,
0.004968293011188507,
-0.029074858874082565,
0.03717728331685066,
0.006098432932049036,
0.06719083338975906,
-0.051381226629018784,
-0.005416025873273611,
-0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_webfilter_content_filter_foreign_attributes(mocker):
schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')
set_method_result = {'status': 'success', 'http_method': 'POST', 'http_status': 200}
set_method_mock = mocker.patch('ansible.module_utils.net... | |
20,252 | [
-0.011310669593513012,
0.005757627543061972,
0.03731644153594971,
-0.012380360625684261,
-0.050176117569208145,
-0.03740996494889259,
-0.007014368660748005,
-0.009282347746193409,
0.0006955915596336126,
0.01944149099290371,
0.007096203044056892,
-0.033014293760061264,
-0.0009330571629106998,... | 9 | {"_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 TestAttachTags(mkt.site.tests.TestCase):
def test_attach_tags_apps(self):
tag1 = Tag.objects.create(tag_text='abc', blocked=False)
tag2 = Tag.objects.create(tag_text='xyz', blocked=False)
tag3 = Tag.objects.create(tag_text='swearword', blocked=True)
app1 = app_factory()
... | |
20,253 | [
-0.0177594143897295,
-0.024181030690670013,
0.01831218972802162,
-0.0019214862259104848,
-0.047773998230695724,
-0.04939704388380051,
-0.0069449893198907375,
-0.002319897059351206,
0.014713263139128685,
0.028626764193177223,
0.032437391579151154,
0.014501561410725117,
-0.028085749596357346,
... | 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 test_attach_tags_websites(self):
tag1 = Tag.objects.create(tag_text='abc', blocked=False)
tag2 = Tag.objects.create(tag_text='xyz', blocked=False)
tag3 = Tag.objects.create(tag_text='swearword', blocked=True)
website1 = website_factory()
website1.keywords.add(tag1)
w... | |
20,254 | [
-0.003306744387373328,
-0.008537954650819302,
0.02427329123020172,
0.010116850025951862,
-0.050429340451955795,
-0.05452851206064224,
0.0021225723903626204,
-0.035605594515800476,
0.02538149803876877,
0.008591577410697937,
0.012059190310537815,
0.00020965057774446905,
-0.01973322033882141,
... | 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 test_attach_tags_apps(self):
tag1 = Tag.objects.create(tag_text='abc', blocked=False)
tag2 = Tag.objects.create(tag_text='xyz', blocked=False)
tag3 = Tag.objects.create(tag_text='swearword', blocked=True)
app1 = app_factory()
app1.tags.add(tag1)
app1.tags.add(tag2)
... | |
20,255 | [
0.04878281429409981,
0.030970752239227295,
0.055426787585020065,
-0.02162523753941059,
0.03531389683485031,
0.02030678279697895,
0.0182903241366148,
-0.0009209791896864772,
-0.03073808364570141,
0.06282047182321548,
0.028747476637363434,
0.023602919653058052,
0.025296228006482124,
-0.01218... | 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": "logfile", "annotation": null, "type_comment": null}}, {"_type": "... | def __init__(self, logfile, prefs, lock_file,
ignore_offset=0, first_time=0,
noemail=0, daemon=0, foreground=0):
self.__denied_hosts = {}
self.__prefs = prefs
self.__lock_file = lock_file
self.__first_time = first_time
self.__noemail = noemail
... | |
20,256 | [
0.013887887820601463,
0.03387652710080147,
0.0570395402610302,
-0.023683808743953705,
0.02047223411500454,
0.015723073855042458,
-0.01175510510802269,
-0.011345908045768738,
-0.034124523401260376,
0.03861328959465027,
0.03023095615208149,
-0.00595195172354579,
0.034446921199560165,
-0.0208... | 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": "logfile", "annotation"... | class DenyHosts(object):
def __init__(self, logfile, prefs, lock_file,
ignore_offset=0, first_time=0,
noemail=0, daemon=0, foreground=0):
self.__denied_hosts = {}
self.__prefs = prefs
self.__lock_file = lock_file
self.__first_time = first_time
... | |
20,257 | [
0.036800824105739594,
0.047486312687397,
0.014639120548963547,
-0.014724603854119778,
0.008457564748823643,
0.04778550565242767,
-0.024320174008607864,
0.04398147389292717,
0.010279440321028233,
0.01809053309261799,
0.04846937954425812,
0.018517952412366867,
-0.015269564464688301,
0.034685... | 7 | {"_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": "signum", "annotation": null, "type_comment": null}}, {"_type": "a... | def killdaemon(self, signum, frame):
debug("Received SIGTERM")
info("DenyHosts daemon is shutting down")
# signal handler
# self.__lock_file.remove()
# lock will be freed on SIGTERM by denyhosts.py
# exception handler (SystemExit)
sys.exit(0) | |
20,258 | [
0.009017095901072025,
0.027835382148623466,
-0.02021351456642151,
-0.03876659274101257,
-0.006463020574301481,
0.05516340956091881,
0.009213119745254517,
-0.008659640327095985,
0.02995705045759678,
-0.002153379376977682,
0.04716102406382561,
0.03542265668511391,
-0.002056808676570654,
0.02... | 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": "signum", "annotation": null, "type_comment": null}}, {"_type": "a... | def toggledebug(self, signum, frame):
level = logging.getLogger().getEffectiveLevel()
if level == logging.INFO:
level = logging.DEBUG
name = "DEBUG"
else:
level = logging.INFO
name = "INFO"
info("setting debug level to: %s", name)
l... | |
20,259 | [
0.02462851256132126,
0.06220066174864769,
-0.001948538701981306,
-0.0762377679347992,
0.013312365859746933,
0.031481772661209106,
0.014520268887281418,
0.0006591814453713596,
-0.0025032206904143095,
0.023878341540694237,
0.08518896996974945,
-0.007927659898996353,
-0.01129071693867445,
-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": "logfile", "annotation": null, "type_comment": null}}, {"_type": "... | def daemonloop(self, logfile, last_offset, daemon_sleep,
purge_time, purge_sleep_ratio, sync_sleep_ratio):
fp = open(logfile, "r")
inode = os.fstat(fp.fileno())[ST_INO]
while 1:
try:
curr_inode = os.stat(logfile)[ST_INO]
except OSErro... | |
20,260 | [
0.036003950983285904,
0.05926189571619034,
0.013674917630851269,
-0.037791214883327484,
0.01842527464032173,
0.059073761105537415,
-0.00010132358147529885,
0.024598389863967896,
-0.012769526802003384,
0.03146524354815483,
0.06095509231090546,
-0.0020753422286361456,
-0.018072526901960373,
... | 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": "logfile", "annotation": null, "type_comment": null}}, {"_type": "... | def rundaemon(self, logfile, last_offset):
# signal.signal(signal.SIGHUP, self.killdaemon)
signal.signal(signal.SIGTERM, self.killdaemon)
signal.signal(signal.SIGUSR1, self.toggledebug)
info("DenyHost daemon is now running, pid: %s", os.getpid())
info("send daemon process a TERM ... | |
20,261 | [
0.022668002173304558,
0.023959452286362648,
-0.001588174607604742,
-0.026173364371061325,
-0.009126238524913788,
0.0013514090096578002,
-0.0025998095516115427,
0.052100736647844315,
0.021216660737991333,
0.029494231566786766,
0.048927463591098785,
0.01354176364839077,
-0.0011484670685604215,... | 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": "sleep_time", "annotation": null, "type_comment": null}}, {"_type"... | def sleepandpurge(self, sleep_time, purge_time,
purge_sleep_ratio=None, sync_sleep_ratio=None):
time.sleep(sleep_time)
if purge_time:
self.purge_counter += 1
if self.purge_counter == purge_sleep_ratio:
try:
purged_hosts = ... | |
20,262 | [
0.009784207679331303,
0.01908133551478386,
0.03375460207462311,
0.02090788446366787,
0.005902793724089861,
-0.01534300111234188,
-0.023708589375019073,
0.009138827212154865,
-0.02106618508696556,
0.061323296278715134,
0.004292387515306473,
0.006021519191563129,
0.02081046812236309,
-0.0037... | 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 get_denied_hosts(self):
self.__denied_hosts = {}
with open(self.__prefs.get('HOSTS_DENY'), 'r') as fhdh:
line = fhdh.readline()
while line:
if line[0] not in ('#', '\n'):
idx = line.find('#')
if idx != 1:
... | |
20,263 | [
0.014035568572580814,
0.011095059104263783,
0.03157423064112663,
-0.0025722209829837084,
0.015566721558570862,
-0.004889249801635742,
-0.01629749871790409,
-0.0016442494234070182,
-0.048486508429050446,
0.045029815286397934,
0.02358207479119301,
0.011419848538935184,
0.02568161115050316,
-... | 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": "deny_hosts", "annotation": null, "type_comment": null}}], "kwarg"... | def update_hosts_deny(self, deny_hosts):
if not deny_hosts:
return None, None
# info("keys: %s", str( self.__denied_hosts.keys()))
new_hosts = [host for host in deny_hosts
if host not in self.__denied_hosts
and host not in self.__allowed_hos... | |
20,264 | [
0.034458719193935394,
0.055240798741579056,
0.06934483349323273,
-0.03459228202700615,
0.016882101073861122,
0.02733992226421833,
-0.015853682532906532,
0.0036962986923754215,
-0.005669661331921816,
0.02740670181810856,
0.04196484386920929,
-0.006527790334075689,
0.015907106921076775,
-0.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": "logfile", "annotation": null, "type_comment": null}}, {"_type": "... | def process_log(self, logfile, offset):
try:
if logfile.endswith(".gz"):
fp = gzip.open(logfile)
elif logfile.endswith(".bz2"):
if HAS_BZ2:
fp = bz2.BZ2File(logfile, "r")
else:
raise Exception("Can no... | |
20,265 | [
0.03967414051294327,
0.03997915983200073,
0.036188218742609024,
-0.05477253720164299,
0.015468775294721127,
-0.001809683395549655,
0.013605986721813679,
-0.02703767642378807,
-0.03490278497338295,
-0.019052738323807716,
0.026209769770503044,
0.02679801918566227,
0.009929428808391094,
-0.04... | 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": "hosts", "annotation": null, "type_comment": null}}], "kwarg": nul... | def sync_add_hosts(self, hosts):
try:
filename = os.path.join(self.__prefs.get("WORK_DIR"), SYNC_HOSTS)
fp = open(filename, "a")
for host in hosts:
fp.write("%s\n" % host)
fp.close()
os.chmod(filename, 0o644)
except Exception as... | |
20,266 | [
0.0357489213347435,
-0.014011001214385033,
0.06367553025484085,
0.0188999455422163,
-0.017528656870126724,
0.03331637382507324,
0.048173997551202774,
-0.001830373308621347,
-0.024730907753109932,
0.027878912165760994,
0.004012512043118477,
-0.011584415100514889,
0.022560693323612213,
0.012... | 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 init_regex(self):
self.__sshd_format_regex = self.get_regex('SSHD_FORMAT_REGEX', SSHD_FORMAT_REGEX)
self.__successful_entry_regex = self.get_regex('SUCCESSFUL_ENTRY_REGEX',
SUCCESSFUL_ENTRY_REGEX)
self.__failed_entry_regex_map = {}
... | |
20,267 | [
0.000306594098219648,
0.03254932537674904,
0.02592954784631729,
-0.04301606863737106,
-0.035996608436107635,
0.03964373096823692,
-0.017736010253429413,
0.007793852593749762,
0.007519069127738476,
0.026304252445697784,
-0.014288729056715965,
-0.030251137912273407,
0.04991063103079796,
0.04... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def get_defaults_flag(module):
connection = get_connection(module)
out = connection.get('show running-config ?')
out = to_text(out, errors='surrogate_then_replace')
commands = set()
for line in out.splitlines():
if line.strip():
commands.add(line.strip().split()[0])
if 'all... | |
20,268 | [
-0.013455761596560478,
0.014396502636373043,
-0.02255663461983204,
-0.008894755505025387,
-0.009766790084540844,
0.007880023680627346,
0.002954348223283887,
-0.014491633512079716,
0.0003871306253131479,
-0.04739641398191452,
-0.018138324841856956,
-0.04743869602680206,
0.005628588609397411,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def get_connection(module):
if hasattr(module, '_ios_connection'):
return module._ios_connection
capabilities = get_capabilities(module)
network_api = capabilities.get('network_api')
if network_api == 'cliconf':
module._ios_connection = Connection(module._socket_path)
else:
... | |
20,269 | [
0.04444413259625435,
0.010394962504506111,
-0.0365196168422699,
-0.012531240470707417,
-0.011146836914122105,
0.01827174238860607,
-0.024203196167945862,
-0.07499649375677109,
0.019142961129546165,
0.03587515279650688,
-0.012913145124912262,
-0.00032036713673733175,
0.02300974540412426,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "flags", "annotation": null, "type_comment": null}}], "kwarg": n... | def get_config(module, flags=None):
flag_str = ' '.join(to_list(flags))
try:
return _DEVICE_CONFIGS[flag_str]
except KeyError:
connection = get_connection(module)
out = connection.get_config(flags=flags)
cfg = to_text(out, errors='surrogate_then_replace').strip()
_DE... | |
20,270 | [
-0.0025600327644497156,
0.01882823556661606,
0.05699489265680313,
-0.032360270619392395,
-0.03226309269666672,
-0.01779572106897831,
-0.00247044675052166,
0.039259910583496094,
0.037316348403692245,
0.04324420914053917,
0.01090823020786047,
-0.01839093491435051,
0.01857314445078373,
-0.008... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "commands", "annotation": null, "type_comment": null}}, {"_type"... | def run_commands(module, commands, check_rc=True):
responses = list()
connection = get_connection(module)
for cmd in to_list(commands):
if isinstance(cmd, dict):
command = cmd['command']
prompt = cmd['prompt']
answer = cmd['answer']
else:
comm... | |
20,271 | [
-0.007345173973590136,
0.02223403938114643,
0.03512604534626007,
-0.049232516437768936,
-0.013709434308111668,
0.07880005240440369,
-0.012331483885645866,
0.025223489850759506,
0.022981401532888412,
0.024546192958950996,
0.015367644838988781,
-0.05563180893659592,
0.007613757159560919,
-0.... | 13 | {"_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():
module = AnsibleModule(
argument_spec=dict(
timeout=dict(default="30m"),
puppetmaster=dict(required=False, default=None),
manifest=dict(required=False, default=None),
logdest=dict(
required=False, default='stdout',
c... | |
20,272 | [
-0.005741413217037916,
0.04758351296186447,
0.012897527776658535,
-0.049566157162189484,
0.012670349329710007,
0.015282899141311646,
0.02763313427567482,
-0.04109860584139824,
0.01224697194993496,
-0.020611261948943138,
0.01412635575979948,
0.013806240633130074,
0.04721176624298096,
-0.030... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "basedir", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "basename", "annotation": null, "type_comment": null}}, {"_type... | def _write_structured_data(basedir, basename, data):
if not os.path.exists(basedir):
os.makedirs(basedir)
file_path = os.path.join(basedir, "{0}.json".format(basename))
# This is more complex than you might normally expect because we want to
# open the file with only u+rw set. Also, we use the s... | |
20,273 | [
0.024109240621328354,
-0.003658301429823041,
0.06273496150970459,
-0.019949547946453094,
0.014272416010499,
0.0060007814317941666,
0.026719659566879272,
0.0567500963807106,
-0.0678284615278244,
-0.050043653696775436,
-0.024788374081254005,
0.008828735910356045,
-0.00032630242640152574,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {... | class Migration(migrations.Migration):
dependencies = [
('tienda', '0004_auto_20140913_0036'),
]
operations = [
migrations.AlterField(
model_name='product',
name='price',
field=models.DecimalField(max_digits=20, decimal_places=2),
),
migr... | |
20,274 | [
0.0007562136743217707,
0.013544779270887375,
0.03733847662806511,
0.026542073115706444,
-0.02507481351494789,
0.034250661730766296,
-0.024286434054374695,
0.014749245718121529,
-0.03606831282377243,
0.03438205644488335,
0.006580769550055265,
-0.04896705970168114,
0.018056055530905724,
-0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "current_directory", "annotation": null, "type_comment": null}}... | def admin_permissions(request, current_directory, template, ctx):
language = ctx.get("language", None)
negative_permissions_excl = list(PERMISSIONS["negative"])
positive_permissions_excl = list(PERMISSIONS["positive"])
# Don't provide means to alter access permissions under /<lang_code>/*
# In oth... | |
20,275 | [
0.042401883751153946,
0.01746448501944542,
0.0834752544760704,
-0.030113087967038155,
-0.05283629149198532,
-0.0046359761618077755,
0.022418752312660217,
0.004307306371629238,
-0.027456050738692284,
0.007701256312429905,
0.04851860553026199,
-0.03575929254293442,
-0.009168162010610104,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "extended", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "verbose", "annotation": null, "type_comment": null}}], "kwarg... | def main(extended=True, verbose=True):
target_set = []
species = []
stats = tools.Statistics(lambda ind: ind.fitness.values)
stats.register("avg", numpy.mean)
stats.register("std", numpy.std)
stats.register("min", numpy.min)
stats.register("max", numpy.max)
logbook = tools.Logb... | |
20,276 | [
0.005278339609503746,
-0.0034190418664366007,
0.04896150529384613,
0.009575382806360722,
-0.04706088826060295,
0.01777695119380951,
-0.025782261043787003,
-0.014419886283576488,
-0.017095208168029785,
0.040181487798690796,
-0.007669602986425161,
-0.05697714537382126,
0.005515916272997856,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "PermissionSet", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model",... | class PermissionSetForm(forms.ModelForm):
class Meta(object):
model = PermissionSet
fields = (
"user",
"directory",
"positive_permissions",
"negative_permissions",
)
directory = forms.ModelChoiceField(
... | |
20,277 | [
-0.014871048741042614,
0.0341062918305397,
0.061754584312438965,
-0.044222135096788406,
-0.038117311894893646,
-0.04805656895041466,
0.003392970422282815,
-0.028178052976727486,
-0.02498689480125904,
-0.0026093709748238325,
0.025075186043977737,
0.02525177225470543,
-0.0295402854681015,
0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "wks", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "plot", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def add_titles(wks,plot,title="",left="",center="",right=""):
vpx = Ngl.get_float(plot,"vpXF") #-- retrieve value of res.vpXF from plot
vpy = Ngl.get_float(plot,"vpYF") #-- retrieve value of res.vpYF from plot
vpw = Ngl.get_float(plot,"vpWidthF") #-- retrieve value of res.vpWid... | |
20,278 | [
-0.009775334969162941,
0.010261028073728085,
0.019931847229599953,
-0.05877497419714928,
-0.023337844759225845,
0.014349455013871193,
0.013328884728252888,
0.0007781074964441359,
-0.02267386019229889,
0.02493632771074772,
0.02059583179652691,
0.0720546767115593,
0.0035474016331136227,
-0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "host", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "user", "annotation": null, "type_comment": null}}, {"_type": "arg... | def main(host, user, password, tempest_filter, tempest_dir, tempest_list_file,
tempest_repo, tempest_branch, is_venv, wait_time=0, kill_time=0,
test_time='', patch_set=None):
cmd = './run_tempest.sh {venv} -- {filter_or_list}'.format(
venv='-V' if is_venv else '-N',
filter_or_list=... | |
20,279 | [
0.03952103853225708,
0.0013036453165113926,
-0.05739332735538483,
-0.001273455680347979,
0.025600850582122803,
0.029530996456742287,
0.028433190658688545,
-0.005801907740533352,
0.014809411019086838,
0.03260485455393791,
0.047688718885183334,
-0.010643234476447105,
-0.053792521357536316,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "future", "annotation": null, "type_comment": null}}], "kwarg": nu... | def optimize_in_thread(loop, future):
# This function runs in a separate thread, never use the loop in any other way than
# abc_threadsafe.
def fun_for_scipy(x, *args):
# Scipy uses an array becuase "minimize" can optimize a function with more variables,
# take just the f... | |
20,280 | [
-0.009665156714618206,
-0.015281015075743198,
0.035018522292375565,
-0.07695930451154709,
-0.02265571616590023,
0.02730449289083481,
0.010666171088814735,
-0.001567972358316183,
-0.02313077263534069,
0.05135144665837288,
-0.003941845614463091,
0.0572783537209034,
0.009093957021832466,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "p", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def define_cli(p):
repo = 'https://github.com/CiscoSystems/tempest.git'
branch = 'ipv6'
p.add_argument('-r', '--remote', required=True,
help='ip address of DNS name of the host where tempest is deployed')
p.add_argument('-u', '--user', default='localadmin',
help='us... | |
20,281 | [
0.02691773511469364,
0.056186575442552567,
0.07533127814531326,
-0.04337545856833458,
0.020752087235450745,
-0.003943496383726597,
0.014178593643009663,
-0.004306357819586992,
-0.031859852373600006,
-0.021339863538742065,
-0.01831701584160328,
0.004969105124473572,
0.022167546674609184,
0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {... | class Migration(migrations.Migration):
dependencies = [
('auth', '0006_require_contenttypes_0002'),
]
operations = [
migrations.CreateModel(
name='ChristmasGroup',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False,... | |
20,282 | [
0.0510057732462883,
0.010085232555866241,
-0.0380224883556366,
-0.012322531081736088,
-0.01995021291077137,
-0.012647113762795925,
0.0028995044995099306,
-0.027774963527917862,
0.01349334605038166,
0.01614796370267868,
0.004254345316439867,
-0.028540048748254776,
-0.028470495715737343,
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": "obj", "annotation": null, "type_comment": null}}], "kwarg": null,... | def __array_finalize__(self, obj):
#note: getattr is necessary here, because __array_finalize__ is called by numpy.asarray()
#just before key, tag, specs and history are set
if not (obj is None) and not (type(obj) == numpy.ndarray):
self.__key = getattr(obj, 'key', None)
... | |
20,283 | [
0.016552511602640152,
0.00867692194879055,
0.008964900858700275,
-0.024828767403960228,
-0.021648481488227844,
0.016853012144565582,
0.01681545004248619,
0.0077503821812570095,
0.032604191452264786,
0.026393869891762733,
0.008238693699240685,
0.012495769187808037,
-0.018793737515807152,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "m", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def replace_time(m):
t = float(m.group(1))
if .9 < abs(t-T) < 1.1:
return "Timeout=T+1"
elif 2.4 < abs(t-T) < 2.6:
return "Timeout=T+2.5"
else:
return m.group(0) | |
20,284 | [
0.018672844395041466,
0.00630093552172184,
0.04365319386124611,
-0.006327216513454914,
0.011925128288567066,
0.0023571017663925886,
-0.003978327848017216,
-0.05445479974150658,
0.050013262778520584,
0.0023258926812559366,
0.0057884505949914455,
-0.047096043825149536,
0.019487563520669937,
... | 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": "sms", "annotation": null, "type_comment": null}}], "kwarg": null,... | def _convert_to_sailfish(self, sms):
entry = dict()
entry["type"] = 2
entry["startTime"] = entry["endTime"] = sms.attributes["date"].value[:-3]
entry["isDraft"] = 0
entry["isRead"] = 1
entry["isMissedCall"] = 0
entry["isEmergencyCall"] = 0
entry["bytesRece... | |
20,285 | [
-0.01836242899298668,
0.003578383009880781,
0.038854554295539856,
-0.009948895312845707,
0.01286484394222498,
-0.007398214191198349,
-0.022522764280438423,
0.06745685636997223,
0.004714426584541798,
0.07716429978609085,
-0.022782783955335617,
-0.04947826638817787,
-0.020207339897751808,
0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "reviews", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "i", "annotation": null, "type_comment": null}}], "kwarg": null... | def learn_for(reviews, i):
reg = ElasticNetCV(fit_intercept=True, alphas=[
0.0125, 0.025, 0.05, .125, .25, .5, 1., 2., 4.])
nusers,nmovies = reviews.shape
u = reviews[i]
us = np.arange(reviews.shape[0])
us = np.delete(us, i)
ps, = np.where(u.ravel() > 0)
x = reviews[us... | |
20,286 | [
-0.009337907657027245,
-0.009912126697599888,
0.04746883362531662,
-0.0023122599814087152,
0.005253427196294069,
-0.034890688955783844,
0.038636788725852966,
-0.04481648653745651,
0.010493182577192783,
0.03439849987626076,
0.029832083731889725,
-0.03171880543231964,
-0.0150801045820117,
0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "s", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "ca", "annotation": null, "type_comment": null}}, {"_type": "arg", "_... | def julia(s,ca,cb):
pal = [((min(255,v)),(min(255,v*3/2)),(min(255,v*2))) for v in range(0,256)]
for y in range(0,SH):
for x in range(0,SW):
i=0
a=((float(x)/SW) * 4.0 - 2.0)
b=((float(y)/SH) * 4.0 - 2.0)
while i < 15 and (a*a)+(b*b)<4.0:
n... | |
20,287 | [
-0.022577207535505295,
0.010671107098460197,
0.05030021443963051,
-0.017611507326364517,
-0.007416387088596821,
-0.0286363884806633,
-0.026912545785307884,
-0.025111515074968338,
0.013919394463300705,
0.036818213760852814,
0.014562619850039482,
-0.038310497999191284,
0.034065209329128265,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "k", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def make_area_for_roughing(k):
num_spans = kurve.num_spans(k)
if num_spans == 0:
raise "sketch has no spans!"
d, startx, starty, ex, ey, cx, cy = kurve.get_span(k, 0)
d, sx, sy, endx, endy, cx, cy = kurve.get_span(k, num_spans - 1)
a = area.Area()
c = area.Curve()
largey ... | |
20,288 | [
0.01632026396691799,
0.03129749372601509,
0.032112907618284225,
0.004047089722007513,
-0.030841821804642677,
0.01158966589719057,
0.01756736822426319,
-0.003053304273635149,
-0.022040151059627533,
0.049836162477731705,
0.06312260776758194,
-0.012866747565567493,
-0.051562920212745667,
0.04... | 11 | {"_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 main():
pygame.init()
s = pygame.display.set_mode((SW,SH),0,32)
_quit = False
while not _quit:
for e in pygame.event.get():
if e.type in (pygame.locals.QUIT,pygame.locals.KEYDOWN):
_quit = True
x,y = pygame.mouse.get_pos()
ca=((float(x)/SW... | |
20,289 | [
0.027163740247488022,
0.021439865231513977,
-0.01587635464966297,
-0.02854536660015583,
-0.009881088510155678,
0.08506864309310913,
0.005615937057882547,
0.03486136719584465,
0.016715198755264282,
0.03429391607642174,
0.031555335968732834,
-0.04320046305656433,
-0.001390877296216786,
0.016... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "curve", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "need_rapid", "annotation": null, "type_comment": null}}, {"_type... | def cut_curve(curve, need_rapid, p, rapid_down_to_height, final_depth):
prev_p = p
first = True
for vertex in curve.getVertices():
if need_rapid and first:
# rapid across
rapid(vertex.p.x, vertex.p.y)
##rapid down
rapid(z = rapi... | |
20,290 | [
0.012297512963414192,
0.034992411732673645,
-0.010435013100504875,
-0.05124695226550102,
0.0013325964100658894,
0.044624730944633484,
-0.006446630693972111,
0.0400594137609005,
0.004596673417836428,
0.01404713373631239,
0.04096244275569916,
-0.034540899097919464,
0.009437917731702328,
0.00... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "curve", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "need_rapid", "annotation": null, "type_comment": null}}, {"_type... | def cut_curve_lathe(curve, need_rapid, p, rapid_down_to_height, final_depth):
prev_p = p
first = True
l = []
feed(z=0)
for vertex in curve.getVertices():
if need_rapid and first:
# rapid across
rapid(vertex.p.x, vertex.p.y)
first = F... | |
20,291 | [
-0.014382234774529934,
-0.01093116495758295,
0.033454813063144684,
0.004732022061944008,
-0.03847859054803848,
-0.0016227250453084707,
-0.016560686752200127,
0.028720011934638023,
0.02058415673673153,
0.030231591314077377,
0.011292388662695885,
0.0017686036881059408,
-0.008124739862978458,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "p0", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "p1", "annotation": null, "type_comment": null}}, {"_type": "arg", "... | def make_obround(p0, p1, radius):
dir = p1 - p0
d = dir.length()
dir.normalize()
right = area.Point(dir.y, -dir.x)
obround = area.Area()
c = area.Curve()
vt0 = p0 + right * radius
vt1 = p1 + right * radius
vt2 = p1 - right * radius
vt3 = p0 - right * radius
c.appen... | |
20,292 | [
0.011070271022617817,
-0.04030023515224457,
0.05531037598848343,
-0.013136799447238445,
-0.030160780996084213,
0.015501892194151878,
-0.011222479864954948,
0.003805222688242793,
0.008646637201309204,
0.023814840242266655,
0.003538857214152813,
-0.05156369507312775,
-0.030605699867010117,
0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "a", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "old_area", "annotation": null, "type_comment": null}}], "kwarg": nul... | def area_distance(a, old_area):
best_dist = None
for curve in a.getCurves():
for vertex in curve.getVertices():
c = old_area.NearestPoint(vertex.p)
d = c.dist(vertex.p)
if best_dist == None or d < best_dist:
best_dist = d
for cu... | |
20,293 | [
0.025994719937443733,
0.006825773976743221,
-0.026982173323631287,
0.0035147182643413544,
-0.02432839199900627,
0.032215677201747894,
-0.0345115065574646,
-0.0229582991451025,
-0.013194850645959377,
0.015712857246398926,
0.042312391102313995,
-0.03626423701643944,
-0.0003643164236564189,
0... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "curve", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "y0", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def make_zig_curve(curve, y0, y):
global test_count
if rightward_for_zigs:
curve.Reverse()
zig = area.Curve()
zig_started = False
zag_found = False
prev_p = None
for vertex in curve.getVertices():
if prev_p != None:
if m... | |
20,294 | [
-0.005341062787920237,
0.03449070826172829,
0.013356033712625504,
-0.03411258012056351,
-0.02397063747048378,
0.046914923936128616,
-0.03373445197939873,
0.043781861662864685,
0.025240067392587662,
0.01004065852612257,
0.034166596829891205,
-0.033950526267290115,
0.005141870584338903,
0.01... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "curve_list", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "rapid_down_to_height", "annotation": null, "type_comment": ... | def cut_curvelist(curve_list, rapid_down_to_height, depth, clearance_height, keep_tool_down_if_poss):
p = area.Point(0, 0)
first = True
for curve in curve_list:
need_rapid = True
if first == False:
s = curve.FirstVertex().p
if keep_tool_down_if_poss == True:
... | |
20,295 | [
0.052327416837215424,
0.01039454247802496,
-0.04126555472612381,
0.0011730683036148548,
-0.02142634429037571,
0.06016691029071808,
-0.07190210372209549,
-0.021486464887857437,
-0.030877022072672844,
0.01718195714056492,
-0.00395581778138876,
-0.019105758517980576,
0.00814609881490469,
0.02... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "curve", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def add_reorder_zig(curve):
global reorder_zig_list_list
# look in existing lists
s = curve.FirstVertex().p
for curve_list in reorder_zig_list_list:
last_curve = curve_list[len(curve_list) - 1]
e = last_curve.LastVertex().p
if math.fabs(s.x - e.x) < 0.002 and math.fa... | |
20,296 | [
0.05403148755431175,
0.019699975848197937,
-0.04652445763349533,
0.0011968811741098762,
-0.027900330722332,
0.03770250454545021,
-0.059960607439279556,
-0.01630507782101631,
-0.03452277556061745,
-0.008726324886083603,
0.01801448129117489,
-0.026489773765206337,
0.0006428940105251968,
0.00... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Global", "_fields": {"names": ["curve_list_for_zigs"]}}, {"_ty... | def reorder_zigs():
global curve_list_for_zigs
global reorder_zig_list_list
reorder_zig_list_list = []
for curve in curve_list_for_zigs:
add_reorder_zig(curve)
curve_list_for_zigs = []
for curve_list in reorder_zig_list_list:
for curve in curve_list:
... | |
20,297 | [
0.019832393154501915,
-0.015258313156664371,
0.05156650021672249,
-0.01617995649576187,
-0.03352050110697746,
-0.008920595049858093,
-0.011372620239853859,
-0.002018227707594633,
-0.000044424297811929137,
0.0273989699780941,
0.015372096560895443,
-0.046537287533283234,
-0.008209450170397758,... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "a", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def rotated_area(a):
an = area.Area()
for curve in a.getCurves():
curve_new = area.Curve()
for v in curve.getVertices():
curve_new.append(rotated_vertex(v))
an.append(curve_new)
return an | |
20,298 | [
0.01500693615525961,
0.0014998523984104395,
0.008001456037163734,
-0.0072612036019563675,
-0.03951602056622505,
0.0056292833760380745,
-0.03625890985131264,
-0.014508947730064392,
-0.008438877761363983,
0.008411959744989872,
0.022947825491428375,
-0.045384205877780914,
0.0017984770238399506,... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "a", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "a_firstoffset", "annotation": null, "type_comment": null}}, {"_type"... | def zigzag(a, a_firstoffset, stepover):
if a.num_curves() == 0:
return
global rightward_for_zigs
global curve_list_for_zigs
global test_count
global sin_angle_for_zigs
global cos_angle_for_zigs
global sin_minus_angle_for_zigs
global cos_minus_angle_for_zigs
... | |
20,299 | [
0.017384104430675507,
0.0070000882260501385,
0.01217550877481699,
-0.017742402851581573,
-0.02286474220454693,
-0.007046534214168787,
-0.009348932653665543,
0.012016264721751213,
-0.001670400146394968,
-0.0010458662873134017,
0.03569713234901428,
-0.05191344767808914,
0.0021663778461515903,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "a", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "tool_radius", "annotation": null, "type_comment": null}}, {"_type": ... | def pocket(a, tool_radius, extra_offset, rapid_down_to_height, start_depth, final_depth, stepover, stepdown, round_corner_factor, clearance_height, from_center, keep_tool_down_if_poss, use_zig_zag, zig_angle):
global area_for_feed_possible
global tool_radius_for_pocket
global sin_angle_for_zigs
glob... | |
20,300 | [
0.04015444964170456,
-0.01744820550084114,
0.011553541757166386,
0.024592537432909012,
-0.015703385695815086,
-0.057767707854509354,
-0.021491944789886475,
-0.020301222801208496,
0.005608772858977318,
0.04817119613289833,
0.015408651903271675,
-0.016398955136537552,
-0.004261841997504234,
... | 6 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "ewayCustomerFirstName"}}, {"_type": "Constant", "_fields": {"kind": null, "value": "First Name"}}]... | class Customer(Validator):
first_name = Field("ewayCustomerFirstName", "First Name", default="")
last_name = Field("ewayCustomerLastName", "Last Name", default="")
email = Field("ewayCustomerEmail", "Email", default="")
address = Field("ewayCustomerAddress", "Address", default="")
postcode = Field("... |