max_stars_repo_path
stringlengths
4
286
max_stars_repo_name
stringlengths
5
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.03M
content_cleaned
stringlengths
6
1.03M
language
stringclasses
111 values
language_score
float64
0.03
1
comments
stringlengths
0
556k
edu_score
float64
0.32
5.03
edu_int_score
int64
0
5
Room-DESKTOP-549B209.py
AldoAbdn/Polar-Simulator-2017
0
6624851
<filename>Room-DESKTOP-549B209.py import pygame, sys from Scene import Scene from Grid import Grid from Player import Player from GridSquare import GridSquare from GridSquare import GridSquareStar from Wall import Wall from Crate import Crate from SpriteManager import SpriteManager class Room(object): "...
<filename>Room-DESKTOP-549B209.py import pygame, sys from Scene import Scene from Grid import Grid from Player import Player from GridSquare import GridSquare from GridSquare import GridSquareStar from Wall import Wall from Crate import Crate from SpriteManager import SpriteManager class Room(object): "...
en
0.853899
Main game scene that will be drawn onto another scene that will contain UI elements #Sets image, if no image generates a blank surface #Sets up rect #Squares #Star Squares #Walls #Crates #Getters #Setters #Moves #Draw #Setup #Event Handlers #W key #S key #A key #D key #Special #Used to predict where a sprite will be if...
2.762022
3
symphony/cli/graphql_compiler/gql/renderer_dataclasses.py
remo5000/magma
1
6624852
<reponame>remo5000/magma<gh_stars>1-10 #!/usr/bin/env python3 from graphql import GraphQLSchema from .utils_codegen import CodeChunk from .query_parser import ParsedQuery, ParsedField, ParsedObject, ParsedEnum, \ ParsedOperation, ParsedVariableDefinition class DataclassesRenderer: def __init__(self, schema:...
#!/usr/bin/env python3 from graphql import GraphQLSchema from .utils_codegen import CodeChunk from .query_parser import ParsedQuery, ParsedField, ParsedObject, ParsedEnum, \ ParsedOperation, ParsedVariableDefinition class DataclassesRenderer: def __init__(self, schema: GraphQLSchema): self.schema = ...
en
0.560359
#!/usr/bin/env python3 # We sort fragment nodes to be first and operations to be last because # of dependecies # Enums # render child objects # render fields # pass if not children or fields ') buffer.write(parsed_query.query) buffer.write(' # Render children # operation fields # Execution funct...
2.310962
2
onnx_tf/handlers/backend/top_k.py
jsigee87/onnx-tensorflow
18
6624853
<reponame>jsigee87/onnx-tensorflow import tensorflow as tf from onnx_tf.handlers.backend_handler import BackendHandler from onnx_tf.handlers.handler import onnx_op from onnx_tf.handlers.handler import tf_func @onnx_op("TopK") @tf_func(tf.nn.top_k) class TopK(BackendHandler): @classmethod def version_1(cls, node...
import tensorflow as tf from onnx_tf.handlers.backend_handler import BackendHandler from onnx_tf.handlers.handler import onnx_op from onnx_tf.handlers.handler import tf_func @onnx_op("TopK") @tf_func(tf.nn.top_k) class TopK(BackendHandler): @classmethod def version_1(cls, node, **kwargs): x = kwargs["tensor...
none
1
1.982141
2
model/network_imnet_test.py
ruofeidu/mdif
6
6624854
#!/usr/bin/python # # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
#!/usr/bin/python # # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
en
0.795502
#!/usr/bin/python # # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
1.970894
2
sdk/python/pulumi_artifactory/remote_puppet_repository.py
pulumi/terraform-provider-artifactory
4
6624855
<reponame>pulumi/terraform-provider-artifactory # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Op...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import ...
en
0.793742
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** The set of arguments for constructing a RemotePuppetRepository resource. :param pulumi.Input[str] key: A mandatory identifier fo...
1.429007
1
geocoder/yandex_reverse.py
lavr/geocoder
2
6624856
<filename>geocoder/yandex_reverse.py #!/usr/bin/python # coding: utf8 from __future__ import absolute_import import logging from geocoder.yandex import YandexResult, YandexQuery from geocoder.location import Location class YandexReverseResult(YandexResult): @property def ok(self): return bool(self...
<filename>geocoder/yandex_reverse.py #!/usr/bin/python # coding: utf8 from __future__ import absolute_import import logging from geocoder.yandex import YandexResult, YandexQuery from geocoder.location import Location class YandexReverseResult(YandexResult): @property def ok(self): return bool(self...
en
0.849806
#!/usr/bin/python # coding: utf8 Yandex ====== Yandex (Russian: Яндекс) is a Russian Internet company which operates the largest search engine in Russia with about 60% market share in that country. The Yandex home page has been rated as the most popular website in Russia. Params ------ :...
3.258921
3
python/10950_A+B_3.py
anothel/BOJ
0
6624857
<gh_stars>0 from sys import stdin def main(): for T in range(int(stdin.readline().strip())): A, B = map(int, stdin.readline().strip().split()) print(str(A+B)) if __name__ == "__main__": main()
from sys import stdin def main(): for T in range(int(stdin.readline().strip())): A, B = map(int, stdin.readline().strip().split()) print(str(A+B)) if __name__ == "__main__": main()
none
1
3.187444
3
ppgan/models/discriminators/discriminator_styleganv2.py
pcwuyu/PaddleGAN
3
6624858
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
en
0.86547
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
2.062464
2
skfuzzy/image/tests/test_pad.py
MarcoMiretti/scikit-fuzzy
5
6624859
"""Tests for the array pading functions. """ from __future__ import division, absolute_import, print_function from distutils.version import LooseVersion import numpy as np from numpy.testing import (assert_array_equal, assert_raises, assert_allclose, TestCase) try: from numpy.testing....
"""Tests for the array pading functions. """ from __future__ import division, absolute_import, print_function from distutils.version import LooseVersion import numpy as np from numpy.testing import (assert_array_equal, assert_raises, assert_allclose, TestCase) try: from numpy.testing....
en
0.754407
Tests for the array pading functions. # If input array is int, but constant_values are float, the dtype of # the array to be padded is kept # If input array is float, and constant_values are float, the dtype of # the array to be padded is kept - here retaining the float constants # Attempt to pad using a 3D array equiv...
2.152641
2
zproject/dev_urls.py
shubhamgupta2956/zulip
0
6624860
<reponame>shubhamgupta2956/zulip import os from urllib.parse import urlsplit from django.conf import settings from django.conf.urls.static import static from django.contrib.staticfiles.views import serve as staticfiles_serve from django.http import HttpRequest, HttpResponse from django.urls import path from django.vie...
import os from urllib.parse import urlsplit from django.conf import settings from django.conf.urls.static import static from django.contrib.staticfiles.views import serve as staticfiles_serve from django.http import HttpRequest, HttpResponse from django.urls import path from django.views.generic import TemplateView fr...
en
0.791765
# These URLs are available only in the development environment # Serve useful development environment resources (docs, coverage reports, etc.) # The special no-password login endpoint for development # Page for testing email templates # Listing of useful URLs and various tools for development # Register New User and Re...
1.893692
2
azurelinuxagent/pa/rdma/centos.py
clearlinux/WALinuxAgent
2
6624861
<filename>azurelinuxagent/pa/rdma/centos.py # Microsoft Azure Linux Agent # # Copyright 2014 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.or...
<filename>azurelinuxagent/pa/rdma/centos.py # Microsoft Azure Linux Agent # # Copyright 2014 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.or...
en
0.725564
# Microsoft Azure Linux Agent # # Copyright 2014 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
1.975533
2
mortgage-xgboost/e2e.py
stjordanis/blazingsql-public-demos
1
6624862
<reponame>stjordanis/blazingsql-public-demos<filename>mortgage-xgboost/e2e.py import numpy as np from sklearn.model_selection import train_test_split import xgboost as xgb import cudf from cudf.dataframe import DataFrame from collections import OrderedDict import gc from glob import glob import os import pyblazing impo...
import numpy as np from sklearn.model_selection import train_test_split import xgboost as xgb import cudf from cudf.dataframe import DataFrame from collections import OrderedDict import gc from glob import glob import os import pyblazing import pandas as pd import time from chronometer import Chronometer from pyblazin...
en
0.674004
Loads performance data Returns ------- GPU DataFrame Loads acquisition data Returns ------- GPU DataFrame Loads names used for renaming the banks Returns ------- GPU DataFrame SELECT loan_id, orig_channel, orig_interest_rate, orig_upb, orig_loan_term, orig_date, first_pay...
2.261948
2
src/python/grpcio_tests/tests/interop/server.py
txl0591/grpc
117
6624863
<gh_stars>100-1000 # Copyright 2015 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# Copyright 2015 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
en
0.834055
# Copyright 2015 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
2.199032
2
SemanticMask_generation.py
PingCheng-Wei/SD-MaskRCNN
0
6624864
''' Given a root directory of dataset which contains the SegmentationMask folder, this script will automatically generate the semantic segmentation masks for each image ''' import numpy as np import matplotlib.pyplot as plt import skimage.io import skimage.color import os import sys import argparse def semanticmask_...
''' Given a root directory of dataset which contains the SegmentationMask folder, this script will automatically generate the semantic segmentation masks for each image ''' import numpy as np import matplotlib.pyplot as plt import skimage.io import skimage.color import os import sys import argparse def semanticmask_...
en
0.735333
Given a root directory of dataset which contains the SegmentationMask folder, this script will automatically generate the semantic segmentation masks for each image # make sure root_dir is absolute path # segmask_path = os.path.join(root_dir, 'modal_segmasks') # segmask_800_path = os.path.join(root_dir, 'modal_...
3.070188
3
ringapp/migrations/0003_commlogic_theorem.py
rschwiebert/RingApp
10
6624865
<gh_stars>1-10 # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('ringapp', '0002_logic_theorem'), ] operations = [ migrations.AddField( model_name='commlogic', ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('ringapp', '0002_logic_theorem'), ] operations = [ migrations.AddField( model_name='commlogic', name=...
en
0.769321
# -*- coding: utf-8 -*-
1.462703
1
BTrees/tests/testBTrees.py
azmeuk/BTrees
66
6624866
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
en
0.826757
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
2.084435
2
flink-python/pyflink/table/tests/test_table_environment_api.py
rudikershaw/flink
0
6624867
################################################################################ # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this...
################################################################################ # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this...
en
0.685581
################################################################################ # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this...
1.585718
2
discriminator.py
Dcoder99/CycleGAN-Unpaired-Image-translation
0
6624868
import tensorflow as tf def convLayer(input, k, slope=0.2, stride=2, reuse=False, is_training=True, name=None): with tf.variable_scope(name, reuse=reuse): weights_shape = shape=[4, 4, input.get_shape()[3], k] W_var = tf.get_variable("W_var", weights_shape, initializer=tf.random_normal_initializer(mean...
import tensorflow as tf def convLayer(input, k, slope=0.2, stride=2, reuse=False, is_training=True, name=None): with tf.variable_scope(name, reuse=reuse): weights_shape = shape=[4, 4, input.get_shape()[3], k] W_var = tf.get_variable("W_var", weights_shape, initializer=tf.random_normal_initializer(mean...
ms
0.213645
#leakyRelu
2.665155
3
guestbook.py
kishalayraj/kishalay-sudoku
0
6624869
<reponame>kishalayraj/kishalay-sudoku<gh_stars>0 import os import urllib import Generator import Solver import random from google.appengine.api import users from google.appengine.api import taskqueue from google.appengine.ext import ndb import jinja2 import webapp2 JINJA_ENVIRONMENT = jinja2.Environment( loader=...
import os import urllib import Generator import Solver import random from google.appengine.api import users from google.appengine.api import taskqueue from google.appengine.ext import ndb import jinja2 import webapp2 JINJA_ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.dirname(__file__)...
en
0.761065
# We set a parent key on the 'Greetings' to ensure that they are all # in the same entity group. Queries across the single entity group # will be consistent. However, the write rate should be limited to # ~1/second. Constructs a Datastore key for a Guestbook entity. We use guestbook_name as the key. Sub model for ...
1.964292
2
Code/neuroconnect/plot.py
seankmartin/SKMNeuralConnections
0
6624870
<filename>Code/neuroconnect/plot.py """Plotting functions.""" import os import seaborn as sns import matplotlib.pyplot as plt import pandas as pd from matplotlib.ticker import MaxNLocator here = os.path.dirname(os.path.realpath(__file__)) PALETTE = "dark" LABELSIZE = 12 def load_df(name): """Load a pandas dataf...
<filename>Code/neuroconnect/plot.py """Plotting functions.""" import os import seaborn as sns import matplotlib.pyplot as plt import pandas as pd from matplotlib.ticker import MaxNLocator here = os.path.dirname(os.path.realpath(__file__)) PALETTE = "dark" LABELSIZE = 12 def load_df(name): """Load a pandas dataf...
en
0.76552
Plotting functions. Load a pandas dataframe from csv file at results/name. Despine the current plot with trimming. Set the seaborn palette. # sns.set_context( # "paper", # rc={ # "axes.titlesize": 18, # "axes.labelsize": 14, # "lines.linewidth": 2, # }, # ) Save the figure to figures...
3.020045
3
kubernetes_typed/client/models/v1_job.py
nikhiljha/kubernetes-typed
22
6624871
<reponame>nikhiljha/kubernetes-typed<gh_stars>10-100 # Code generated by `typeddictgen`. DO NOT EDIT. """V1JobDict generated type.""" from typing import TypedDict from kubernetes_typed.client import V1JobSpecDict, V1JobStatusDict, V1ObjectMetaDict V1JobDict = TypedDict( "V1JobDict", { "apiVersion": st...
# Code generated by `typeddictgen`. DO NOT EDIT. """V1JobDict generated type.""" from typing import TypedDict from kubernetes_typed.client import V1JobSpecDict, V1JobStatusDict, V1ObjectMetaDict V1JobDict = TypedDict( "V1JobDict", { "apiVersion": str, "kind": str, "metadata": V1ObjectM...
en
0.397533
# Code generated by `typeddictgen`. DO NOT EDIT. V1JobDict generated type.
1.188471
1
clevrtex-gen/blender_utils.py
karazijal/clevrtex-generation
17
6624872
from pathlib import Path import bpy import bpy_extras def get_camera_coords(cam, pos): """ For a specified point, get both the 3D coordinates and 2D pixel-space coordinates of the point from the perspective of the camera. Inputs: - cam: Camera object - pos: Vector giving 3D world-space posit...
from pathlib import Path import bpy import bpy_extras def get_camera_coords(cam, pos): """ For a specified point, get both the 3D coordinates and 2D pixel-space coordinates of the point from the perspective of the camera. Inputs: - cam: Camera object - pos: Vector giving 3D world-space posit...
en
0.819026
For a specified point, get both the 3D coordinates and 2D pixel-space coordinates of the point from the perspective of the camera. Inputs: - cam: Camera object - pos: Vector giving 3D world-space position Returns a tuple of: - (px, py, pz): px and py give 2D image-space coordinates; pz gives d...
3.035457
3
asn/urls.py
wh8983298/GreaterWMS
1,063
6624873
from django.urls import path, re_path from . import views urlpatterns = [ path(r'list/', views.AsnListViewSet.as_view({"get": "list", "post": "create"}), name="asnlist"), re_path(r'^list/(?P<pk>\d+)/$', views.AsnListViewSet.as_view({ 'get': 'retrieve', 'put': 'update', 'patch': 'partial_update', 'delet...
from django.urls import path, re_path from . import views urlpatterns = [ path(r'list/', views.AsnListViewSet.as_view({"get": "list", "post": "create"}), name="asnlist"), re_path(r'^list/(?P<pk>\d+)/$', views.AsnListViewSet.as_view({ 'get': 'retrieve', 'put': 'update', 'patch': 'partial_update', 'delet...
none
1
2.071627
2
opensitua_core/strings.py
valluzzi/opensitua_core
0
6624874
# ----------------------------------------------------------------------------- # Licence: # Copyright (c) 2012-2019 <NAME> # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY K...
# ----------------------------------------------------------------------------- # Licence: # Copyright (c) 2012-2019 <NAME> # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY K...
en
0.523065
# ----------------------------------------------------------------------------- # Licence: # Copyright (c) 2012-2019 <NAME> # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY K...
2.724059
3
tests/rpreport/test_rpreport.py
niraito/rptools
0
6624875
from rptools.rpreport.rp_report import ( run_report ) import os import fnmatch import tempfile import filecmp __test__ = True data_path = os.path.join( os.path.dirname(__file__), 'data' ) data_input_dir_path = os.path.join( data_path, 'input' ) data_input_tar_file = os.path...
from rptools.rpreport.rp_report import ( run_report ) import os import fnmatch import tempfile import filecmp __test__ = True data_path = os.path.join( os.path.dirname(__file__), 'data' ) data_input_dir_path = os.path.join( data_path, 'input' ) data_input_tar_file = os.path...
en
0.40342
#files = fnmatch.filter(os.listdir(data_input_dir_path), "*.xml") #files.sort() # testing standalone file output from files into a directory # assert filecmp.cmp(tested_output_single_file_html, data_output_standalone_file, shallow=False) # testing standalone file output from tar file # assert filecmp.cmp(tested_output_...
2.033919
2
uplift_modeling/uplift_tools/metrics.py
smn-ailab/ysaito-qiita
14
6624876
<filename>uplift_modeling/uplift_tools/metrics.py """This Module contains tools to evaluate uplift modeling algorithoms.""" import numpy as np import pandas as pd from pandas import DataFrame, Series from plotly.graph_objs import Bar, Box, Figure, Layout, Scatter from plotly.offline import init_notebook_mode, iplot, p...
<filename>uplift_modeling/uplift_tools/metrics.py """This Module contains tools to evaluate uplift modeling algorithoms.""" import numpy as np import pandas as pd from pandas import DataFrame, Series from plotly.graph_objs import Bar, Box, Figure, Layout, Scatter from plotly.offline import init_notebook_mode, iplot, p...
en
0.863134
This Module contains tools to evaluate uplift modeling algorithoms. create a DataFrame that is used to evaluate uplift-model. :param outcome: list of integers or floats which represent the target variable for each suject in the test data. :param treat: list of integers which represent whether a sunject is in t...
2.712638
3
app/apiv2/organizations/locations/roles/schedules/schedule.py
partnerhero/staffjoy
0
6624877
import json from flask import g, current_app from flask_restful import marshal, abort, reqparse, Resource from app import db from app.constants import API_ENVELOPE from app.models import Schedule2, Organization from app.caches import Schedules2Cache from app.apiv2.decorators import verify_org_location_role_schedule, ...
import json from flask import g, current_app from flask_restful import marshal, abort, reqparse, Resource from app import db from app.constants import API_ENVELOPE from app.models import Schedule2, Organization from app.caches import Schedules2Cache from app.apiv2.decorators import verify_org_location_role_schedule, ...
en
0.88637
# Filter out null values # schedule can only be modified from initial or unpublished state if not sudo # now verification # NOTE that if we choose to support lengths of 0, these 1st two checks will break # because None and 0 get evalulated as the same # admins can only modify demand in the unpublished state # demand ca...
2.114784
2
tensorflow_datasets/core/features/text_feature_test.py
rodrigob/datasets
0
6624878
# coding=utf-8 # Copyright 2019 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
# coding=utf-8 # Copyright 2019 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
en
0.799254
# coding=utf-8 # Copyright 2019 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
2.378927
2
hardware/opentrons_hardware/drivers/can_bus/abstract_driver.py
anuwrag/opentrons
2
6624879
"""The can bus transport.""" from __future__ import annotations from abc import ABC, abstractmethod from opentrons_hardware.firmware_bindings import CanMessage class AbstractCanDriver(ABC): """Can driver interface.""" @abstractmethod async def send(self, message: CanMessage) -> None: """Send a ca...
"""The can bus transport.""" from __future__ import annotations from abc import ABC, abstractmethod from opentrons_hardware.firmware_bindings import CanMessage class AbstractCanDriver(ABC): """Can driver interface.""" @abstractmethod async def send(self, message: CanMessage) -> None: """Send a ca...
en
0.49132
The can bus transport. Can driver interface. Send a can message. Args: message: The message to send. Returns: None Read a message. Returns: A can message Raises: ErrorFrameCanError Enter iterator. Returns: CanDriver...
2.985161
3
website/registration/migrations/0009_mark_result.py
CodeJosh723/thesis-review-system
1
6624880
# Generated by Django 3.0.7 on 2020-07-31 08:21 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('registration', '0008_auto_20200728_2047'), ] operations = [ migrations.AddField( model_name='ma...
# Generated by Django 3.0.7 on 2020-07-31 08:21 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('registration', '0008_auto_20200728_2047'), ] operations = [ migrations.AddField( model_name='ma...
en
0.756911
# Generated by Django 3.0.7 on 2020-07-31 08:21
1.414277
1
eng_to_ipa/transcribe.py
binu-alexander/English-to-IPA
195
6624881
# -*- coding: utf-8 -*- import re from os.path import join, abspath, dirname import eng_to_ipa.stress as stress from collections import defaultdict class ModeType(object): def __init__(self, mode): self.name = mode if mode.lower() == "sql": import sqlite3 conn = sqlite3.co...
# -*- coding: utf-8 -*- import re from os.path import join, abspath, dirname import eng_to_ipa.stress as stress from collections import defaultdict class ModeType(object): def __init__(self, mode): self.name = mode if mode.lower() == "sql": import sqlite3 conn = sqlite3.co...
en
0.823404
# -*- coding: utf-8 -*- Returns a string of words stripped of punctuation converts words to IPA and finds punctuation before and after the word. places surrounding punctuation back on center on a list of preserve_punc triples Get the IPA transcription of word with the original punctuation marks fetches a list of words ...
2.965063
3
src/colors_redis.py
stajc06/hue_sms
1
6624882
<reponame>stajc06/hue_sms<gh_stars>1-10 from redis import Redis from name_converter import clean_name class colorsRedis: def __init__(self): self.connect() def connect(self): self.db = Redis('localhost', 6379) def numColors(self): return len(self.db.hgetall("colors")) def re...
from redis import Redis from name_converter import clean_name class colorsRedis: def __init__(self): self.connect() def connect(self): self.db = Redis('localhost', 6379) def numColors(self): return len(self.db.hgetall("colors")) def register_color(self, colorName, r, g, b): ...
none
1
3.101751
3
tests/pytests/test_vecsim.py
Mu-L/RediSearch
0
6624883
<filename>tests/pytests/test_vecsim.py # -*- coding: utf-8 -*- import base64 import random import string import unittest from time import sleep import numpy as np from RLTest import Env from common import * from includes import * def test_sanity(env): conn = getConnectionByEnv(env) vecsim_type = ['FLAT', 'H...
<filename>tests/pytests/test_vecsim.py # -*- coding: utf-8 -*- import base64 import random import string import unittest from time import sleep import numpy as np from RLTest import Env from common import * from includes import * def test_sanity(env): conn = getConnectionByEnv(env) vecsim_type = ['FLAT', 'H...
en
0.413546
# -*- coding: utf-8 -*- # todo: make test work on coordinator # print message_bytes # print base64_bytes # print base64_message # RANGE uses topk but translate to base64 before ##################### ## another example ## ##################### # print message_bytes # print base64_bytes # print base64_message # RANGE use...
2.054932
2
aesara/tensor/sharedvar.py
anirudhacharya/Theano-PyMC
0
6624884
import traceback import warnings import numpy as np from aesara.compile import SharedVariable, shared_constructor from aesara.misc.safe_asarray import _asarray from aesara.tensor import _get_vector_length from aesara.tensor.type import TensorType from aesara.tensor.var import _tensor_py_operators def load_shared_va...
import traceback import warnings import numpy as np from aesara.compile import SharedVariable, shared_constructor from aesara.misc.safe_asarray import _asarray from aesara.tensor import _get_vector_length from aesara.tensor.type import TensorType from aesara.tensor.var import _tensor_py_operators def load_shared_va...
en
0.879861
This function is only here to keep some pickles loading after a failed fix done in August 2011. It can be removed after sufficient time has passed. # _tensor_py_operators is first to have its version of __{gt,ge,lt,le}__ SharedVariable Constructor for TensorType. Notes ----- The default is to assum...
2.236089
2
homeassistant/components/magichome/scene.py
LIULi-VVET/home-assistant
0
6624885
<filename>homeassistant/components/magichome/scene.py """Support for the MagicHome scenes.""" from homeassistant.components.scene import DOMAIN, Scene from . import DATA_MAGICHOME, MagicHomeDevice ENTITY_ID_FORMAT = DOMAIN + ".{}" def setup_platform(hass, config, add_entities, discovery_info=None): """Set up Ma...
<filename>homeassistant/components/magichome/scene.py """Support for the MagicHome scenes.""" from homeassistant.components.scene import DOMAIN, Scene from . import DATA_MAGICHOME, MagicHomeDevice ENTITY_ID_FORMAT = DOMAIN + ".{}" def setup_platform(hass, config, add_entities, discovery_info=None): """Set up Ma...
en
0.310039
Support for the MagicHome scenes. Set up MagicHome scenes. MagicHome Scene. Init MagicHome scene. Activate the scene.
2.276738
2
rcsb/app/file/serverStatus.py
rcsb/py-rcsb_app_file
0
6624886
## # File: serverStatus.py # Date: 11-Aug-2020 # ## # pylint: skip-file __docformat__ = "google en" __author__ = "<NAME>" __email__ = "<EMAIL>" __license__ = "Apache 2.0" import logging from fastapi import APIRouter from . import ConfigProvider from rcsb.utils.io.ProcessStatusUtil import ProcessStatusUtil logger = l...
## # File: serverStatus.py # Date: 11-Aug-2020 # ## # pylint: skip-file __docformat__ = "google en" __author__ = "<NAME>" __email__ = "<EMAIL>" __license__ = "Apache 2.0" import logging from fastapi import APIRouter from . import ConfigProvider from rcsb.utils.io.ProcessStatusUtil import ProcessStatusUtil logger = l...
en
0.41752
## # File: serverStatus.py # Date: 11-Aug-2020 # ## # pylint: skip-file
2.154239
2
myapp/utils.py
codehugger/Flask-Starter
2
6624887
# -*- coding: utf-8 -*- import json import datetime from flask import make_response from myapp.extensions import db class JSONAppEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, datetime.datetime): return obj.isoformat() elif isinstance(obj, db.Model): ...
# -*- coding: utf-8 -*- import json import datetime from flask import make_response from myapp.extensions import db class JSONAppEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, datetime.datetime): return obj.isoformat() elif isinstance(obj, db.Model): ...
en
0.769321
# -*- coding: utf-8 -*-
2.730525
3
universities/urls.py
MadanNeupane/College-Finder
0
6624888
<gh_stars>0 from django.urls import path from . import views from django.contrib.auth.decorators import login_required urlpatterns = [ path('', login_required(views.universities_page), name='universities'), path('<slug:slug>/', login_required(views.university_detail), name='university_detail'), ]
from django.urls import path from . import views from django.contrib.auth.decorators import login_required urlpatterns = [ path('', login_required(views.universities_page), name='universities'), path('<slug:slug>/', login_required(views.university_detail), name='university_detail'), ]
none
1
1.830414
2
src/log.py
winsbe01/nq
0
6624889
import logging class NqLog: def setup(self): nqlog = logging.getLogger("nq") nqlog.setLevel(logging.DEBUG) console = logging.StreamHandler() console.setLevel(logging.DEBUG) formatter = logging.Formatter('%(asctime)s :: %(levelname)s :: %(message)s') console.setFormatter(formatter) nqlog.addHandler(co...
import logging class NqLog: def setup(self): nqlog = logging.getLogger("nq") nqlog.setLevel(logging.DEBUG) console = logging.StreamHandler() console.setLevel(logging.DEBUG) formatter = logging.Formatter('%(asctime)s :: %(levelname)s :: %(message)s') console.setFormatter(formatter) nqlog.addHandler(co...
none
1
2.71735
3
scripts/delete/jobbernetes.py
realmar/Jobbernetes
1
6624890
#!/usr/bin/env python3 import __init__ from lib.jobbernetes import task def delete(): task("delete") if __name__ == "__main__": delete()
#!/usr/bin/env python3 import __init__ from lib.jobbernetes import task def delete(): task("delete") if __name__ == "__main__": delete()
fr
0.221828
#!/usr/bin/env python3
1.38961
1
src/pretix/base/metrics.py
prereg/prereg
0
6624891
import json import math import time from collections import defaultdict from django.apps import apps from django.conf import settings from django.db import connection from pretix.base.models import Event, Invoice, Order, OrderPosition, Organizer from pretix.celery_app import app if settings.HAS_REDIS: import dja...
import json import math import time from collections import defaultdict from django.apps import apps from django.conf import settings from django.db import connection from pretix.base.models import Event, Invoice, Order, OrderPosition, Organizer from pretix.celery_app import app if settings.HAS_REDIS: import dja...
en
0.756257
# inspired by https://github.com/prometheus/client_python/blob/master/prometheus_client/core.py Base Metrics Object Checks if the given labels provides exactly the labels that are required. # test if every required label is provided # now test if no further labels are required Constructs the scrapable metricname usable...
2.120438
2
robo_gym/wrappers/env_wrappers/ur_ee_positioning_training.py
matteolucchi/robo-gym
0
6624892
<reponame>matteolucchi/robo-gym<gh_stars>0 import gym import numpy as np from typing import Tuple class EndEffectorPositioningURTrainingCurriculum(gym.Wrapper): def __init__(self, env, print_reward=False): super().__init__(env) self.env = env # use counter as metric for level up s...
import gym import numpy as np from typing import Tuple class EndEffectorPositioningURTrainingCurriculum(gym.Wrapper): def __init__(self, env, print_reward=False): super().__init__(env) self.env = env # use counter as metric for level up self.episode_counter = 0 self.rewar...
en
0.90488
# use counter as metric for level up # weights # reward for reaching the goal position # reward for collision (ground, table or self) # punishment according to the distance to the goal # punishment delta in two consecutive actions # punishment for acting in general # punishment for deltas in velocity # Calculate distan...
2.880787
3
pyvcloud/schema/vcd/v1_5/schemas/vcloud/vdcTemplateListType.py
h-medjahed/pyvcloud
0
6624893
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated Tue Apr 14 22:18:33 2015 by generateDS.py version 2.15a. # # Command line options: # ('-o', 'schema/vcd/v1_5/schemas/vcloud/VdcTemplateList.py') # # Command line arguments: # /home/eli/perl-VMware-vCloud/etc/1.5/schemas/vcloud/VdcTemplateList.xsd # # Comm...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated Tue Apr 14 22:18:33 2015 by generateDS.py version 2.15a. # # Command line options: # ('-o', 'schema/vcd/v1_5/schemas/vcloud/VdcTemplateList.py') # # Command line arguments: # /home/eli/perl-VMware-vCloud/etc/1.5/schemas/vcloud/VdcTemplateList.xsd # # Comm...
en
0.787102
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated Tue Apr 14 22:18:33 2015 by generateDS.py version 2.15a. # # Command line options: # ('-o', 'schema/vcd/v1_5/schemas/vcloud/VdcTemplateList.py') # # Command line arguments: # /home/eli/perl-VMware-vCloud/etc/1.5/schemas/vcloud/VdcTemplateList.xsd # # Comma...
2.060335
2
wirepas_backend_client/messages/msap_cmds/msap_begin.py
bencorrado/backend-client
0
6624894
import struct cmdMsapBeginReq: bytes = bytes([0x01]) cmdMsapBeginResp: bytes = bytes([0x81]) class MsapBeginReq: """ Command MSAP Begin request """ __is_valid: bool = False __countdown_sec: int = 0x00 @staticmethod def getType() -> int: return int(cmdMsapBeginReq[0]) def __init__(s...
import struct cmdMsapBeginReq: bytes = bytes([0x01]) cmdMsapBeginResp: bytes = bytes([0x81]) class MsapBeginReq: """ Command MSAP Begin request """ __is_valid: bool = False __countdown_sec: int = 0x00 @staticmethod def getType() -> int: return int(cmdMsapBeginReq[0]) def __init__(s...
en
0.656924
Command MSAP Begin request # WP-RM-117, V5.0.A Command MSAP Begin request response # Validate response type # if there is error message this does not pack rest # See WP-RM-117 @ MSAP Scratchpad Update # https://docs.python.org/3/library/struct.html?highlight=struct#format-characters
2.485999
2
devices/debian.py
lynnlincbn/boardfarm
0
6624895
<gh_stars>0 # Copyright (c) 2015 # # All rights reserved. # # This file is distributed under the Clear BSD license. # The full text can be found in LICENSE in the root directory. import sys import time import pexpect import base import atexit import ipaddress import os import binascii import glob from termcolor impor...
# Copyright (c) 2015 # # All rights reserved. # # This file is distributed under the Clear BSD license. # The full text can be found in LICENSE in the root directory. import sys import time import pexpect import base import atexit import ipaddress import os import binascii import glob from termcolor import colored, c...
en
0.2635
# Copyright (c) 2015 # # All rights reserved. # # This file is distributed under the Clear BSD license. # The full text can be found in LICENSE in the root directory. A linux machine running an ssh server. #', '/ # ', ".*:~ #" ] # we need to pick a non-conflicting private network here # also we want it to be consistant...
2.200315
2
river/utils/random.py
fox-ds/river
2,184
6624896
<reponame>fox-ds/river<gh_stars>1000+ import math import random __all__ = ["poisson"] def poisson(rate: float, rng=random) -> int: """Sample a random value from a Poisson distribution. Parameters ---------- rate rng References ---------- [^1] [Wikipedia article](https://www.wikiwand...
import math import random __all__ = ["poisson"] def poisson(rate: float, rng=random) -> int: """Sample a random value from a Poisson distribution. Parameters ---------- rate rng References ---------- [^1] [Wikipedia article](https://www.wikiwand.com/en/Poisson_distribution#/Generati...
en
0.460012
Sample a random value from a Poisson distribution. Parameters ---------- rate rng References ---------- [^1] [Wikipedia article](https://www.wikiwand.com/en/Poisson_distribution#/Generating_Poisson-distributed_random_variables)
3.793205
4
config_manager/eucalyptus/topology/__init__.py
tbeckham/DeploymentManager
0
6624897
<filename>config_manager/eucalyptus/topology/__init__.py #!/usr/bin/env python # Copyright 2009-2014 Eucalyptus Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://ww...
<filename>config_manager/eucalyptus/topology/__init__.py #!/usr/bin/env python # Copyright 2009-2014 Eucalyptus Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://ww...
en
0.818407
#!/usr/bin/env python # Copyright 2009-2014 Eucalyptus Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
2.354354
2
tests/test_storage.py
jfinkels/sbclassifier
3
6624898
# test_storage.py - unit tests for the sbclassifier.storage module # # Copyright (C) 2002-2013 Python Software Foundation; All Rights Reserved # Copyright 2014 <NAME>. # # This file is part of sbclassifier, which is licensed under the Python # Software Foundation License; for more information, see LICENSE.txt. import g...
# test_storage.py - unit tests for the sbclassifier.storage module # # Copyright (C) 2002-2013 Python Software Foundation; All Rights Reserved # Copyright 2014 <NAME>. # # This file is part of sbclassifier, which is licensed under the Python # Software Foundation License; for more information, see LICENSE.txt. import g...
en
0.798716
# test_storage.py - unit tests for the sbclassifier.storage module # # Copyright (C) 2002-2013 Python Software Foundation; All Rights Reserved # Copyright 2014 <NAME>. # # This file is part of sbclassifier, which is licensed under the Python # Software Foundation License; for more information, see LICENSE.txt. #from sb...
2.555397
3
pokemongo_bot/plugin_loader.py
timgates42/PokemonGo-Bot
5,362
6624899
<reponame>timgates42/PokemonGo-Bot from __future__ import print_function import os import sys import importlib import re import requests import zipfile import shutil class PluginLoader(object): folder_cache = [] def _get_correct_path(self, path): extension = os.path.splitext(path)[1] if extension == '.zi...
from __future__ import print_function import os import sys import importlib import re import requests import zipfile import shutil class PluginLoader(object): folder_cache = [] def _get_correct_path(self, path): extension = os.path.splitext(path)[1] if extension == '.zip': correct_path = path e...
en
0.16932
#(.*)', self.plugin_name)
2.469787
2
source/chapter_4/file_4_2.py
lintongtong123/JackokiePapers
0
6624900
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/3/11 15:40 # @Author : <NAME> # @Site : www.jackokie.com # @File : file_4_2.py # @Software: PyCharm # @contact: <EMAIL>
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/3/11 15:40 # @Author : <NAME> # @Site : www.jackokie.com # @File : file_4_2.py # @Software: PyCharm # @contact: <EMAIL>
en
0.183174
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/3/11 15:40 # @Author : <NAME> # @Site : www.jackokie.com # @File : file_4_2.py # @Software: PyCharm # @contact: <EMAIL>
0.990586
1
src/sage/modular/modsym/boundary.py
vbraun/sage
3
6624901
# -*- coding: utf-8 -*- r""" Space of boundary modular symbols Used mainly for computing the cuspidal subspace of modular symbols. The space of boundary symbols of sign 0 is isomorphic as a Hecke module to the dual of the space of Eisenstein series, but this does not give a useful method of computing Eisenstein series...
# -*- coding: utf-8 -*- r""" Space of boundary modular symbols Used mainly for computing the cuspidal subspace of modular symbols. The space of boundary symbols of sign 0 is isomorphic as a Hecke module to the dual of the space of Eisenstein series, but this does not give a useful method of computing Eisenstein series...
en
0.689867
# -*- coding: utf-8 -*- Space of boundary modular symbols Used mainly for computing the cuspidal subspace of modular symbols. The space of boundary symbols of sign 0 is isomorphic as a Hecke module to the dual of the space of Eisenstein series, but this does not give a useful method of computing Eisenstein series, sin...
2.990703
3
udf/buildbib.py
metazool/pegamatites-xDD
0
6624902
<filename>udf/buildbib.py #============================================================================== #BUILD A BASIC BIBLIOGRAPHY #============================================================================== import json,psycopg2, yaml from yaml import Loader # Connect to Postgres with open('./credentials', 'r')...
<filename>udf/buildbib.py #============================================================================== #BUILD A BASIC BIBLIOGRAPHY #============================================================================== import json,psycopg2, yaml from yaml import Loader # Connect to Postgres with open('./credentials', 'r')...
en
0.453891
#============================================================================== #BUILD A BASIC BIBLIOGRAPHY #============================================================================== # Connect to Postgres # Connect to Postgres #initialize the table DELETE FROM bib #load in the bibJSON file #push docid, authors, ti...
2.608432
3
ckan/logic/action/create.py
sirca/ckan
1
6624903
'''API functions for adding data to CKAN.''' import logging import random import re from pylons import config import paste.deploy.converters from sqlalchemy import func import ckan.lib.plugins as lib_plugins import ckan.logic as logic import ckan.rating as ratings import ckan.plugins as plugins import ckan.lib.dicti...
'''API functions for adding data to CKAN.''' import logging import random import re from pylons import config import paste.deploy.converters from sqlalchemy import func import ckan.lib.plugins as lib_plugins import ckan.logic as logic import ckan.rating as ratings import ckan.plugins as plugins import ckan.lib.dicti...
en
0.729784
API functions for adding data to CKAN. # FIXME this looks nasty and should be shared better # Define some shortcuts # Ensure they are module-private so that they don't get loaded as available # actions in the action API. Create a new dataset (package). You must be authorized to create new datasets. If you specify ...
2.044494
2
archiv/tables.py
csae8092/djtranskribus
0
6624904
# generated by appcreator import django_tables2 as tables from django_tables2.utils import A from browsing.browsing_utils import MergeColumn from . models import ( TrpCollection, TrpDocument, TrpPage, TrpTranscript ) class TrpCollectionTable(tables.Table): id = tables.LinkColumn(verbose_name='ID...
# generated by appcreator import django_tables2 as tables from django_tables2.utils import A from browsing.browsing_utils import MergeColumn from . models import ( TrpCollection, TrpDocument, TrpPage, TrpTranscript ) class TrpCollectionTable(tables.Table): id = tables.LinkColumn(verbose_name='ID...
en
0.916869
# generated by appcreator
1.930714
2
neon/layers/convolutional.py
kashif/neon
1
6624905
# ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
# ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
en
0.776917
# ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
2.273493
2
datalad/interface/utils.py
mslw/datalad
298
6624906
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # # ## ### ##...
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # # ## ### ##...
en
0.85687
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # # ## ### ##...
1.830221
2
rave_python/rave_base.py
MaestroJolly/rave-python
0
6624907
<reponame>MaestroJolly/rave-python<filename>rave_python/rave_base.py import os, hashlib, warnings, requests, json from rave_python.rave_exceptions import ServerError, RefundError import base64 from Crypto.Cipher import DES3 from dotenv import load_dotenv load_dotenv() # OR, the same with increased verbosity: load_dote...
import os, hashlib, warnings, requests, json from rave_python.rave_exceptions import ServerError, RefundError import base64 from Crypto.Cipher import DES3 from dotenv import load_dotenv load_dotenv() # OR, the same with increased verbosity: load_dotenv(verbose=True) # OR, explicitly providing path to '.env' from path...
en
0.802604
# OR, the same with increased verbosity: # OR, explicitly providing path to '.env' # python3 only This is the core of the implementation. It contains the encryption and initialization functions. It also contains all direct rave functions that require publicKey or secretKey (refund) # config variables (protected) # Sett...
2.246821
2
src/simian/mac/munki/handlers/pkgs.py
tristansgray/simian
326
6624908
<gh_stars>100-1000 #!/usr/bin/env python # # Copyright 2018 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
#!/usr/bin/env python # # Copyright 2018 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
en
0.801031
#!/usr/bin/env python # # Copyright 2018 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
2.131469
2
raspi/Final_Solution/telem_and_video_stream.py
blake-shaffer/avionics
3
6624909
<reponame>blake-shaffer/avionics #TODO: UDPATE THIS HEADER -> THIS IS NOT CORRECT #This script does the following: # 1) Record H264 Video using PiCam at a maximum bitrate of {bitrate_max} kbps # 2) Record video data to a local BytesIO object # 3) Send raw data over a TCP socket to a ground server # 4) Store raw data t...
#TODO: UDPATE THIS HEADER -> THIS IS NOT CORRECT #This script does the following: # 1) Record H264 Video using PiCam at a maximum bitrate of {bitrate_max} kbps # 2) Record video data to a local BytesIO object # 3) Send raw data over a TCP socket to a ground server # 4) Store raw data to an onboard file # 5) Clears Byt...
en
0.695571
#TODO: UDPATE THIS HEADER -> THIS IS NOT CORRECT #This script does the following: # 1) Record H264 Video using PiCam at a maximum bitrate of {bitrate_max} kbps # 2) Record video data to a local BytesIO object # 3) Send raw data over a TCP socket to a ground server # 4) Store raw data to an onboard file # 5) Clears Byte...
2.833643
3
var/spack/repos/builtin.mock/packages/installed-deps-d/package.py
jeanbez/spack
0
6624910
<filename>var/spack/repos/builtin.mock/packages/installed-deps-d/package.py # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack.package import * class InstalledD...
<filename>var/spack/repos/builtin.mock/packages/installed-deps-d/package.py # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack.package import * class InstalledD...
en
0.611842
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) Used by test_installed_deps test case. # a # / \ # b c b --> d build/link # |\ /| b --> e build/link # |...
1.478592
1
indico/core/db/sqlalchemy/links.py
bpedersen2/indico
1
6624911
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from functools import partial from itertools import chain from sqlalchemy.event import listen from sqlalc...
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from functools import partial from itertools import chain from sqlalchemy.event import listen from sqlalc...
en
0.854646
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. #: The link types that are supported. Can be overridden in the #: model using the mixin. Affects the tabl...
1.880593
2
zenduty/api/members_api.py
Zenduty/zenduty-python-sdk
0
6624912
from zenduty.api_client import ApiClient class MembersApi(object): def __init__(self,api_client=None): if api_client is None: api_client=ApiClient() self.api_client = api_client def add_members_to_team(self,team_id,body): #Adds a member to a given team, identified by id ...
from zenduty.api_client import ApiClient class MembersApi(object): def __init__(self,api_client=None): if api_client is None: api_client=ApiClient() self.api_client = api_client def add_members_to_team(self,team_id,body): #Adds a member to a given team, identified by id ...
en
0.888139
#Adds a member to a given team, identified by id #params str team_id: unique id of team #params dict body: contains the details of the user being added and the team to add to #Sample body: # {"team":"d4a777db-5bce-419c-a725-420ebb505c54","user":"af9eeb6<PASSWORD>"} #Removes a member from a particular team #params str t...
2.77564
3
telegrambotapiwrapper/response.py
pynista/telegrambotapiwrapper
1
6624913
# -*- coding: utf-8 -*- # Copyright (c) 2019 <NAME>; MIT License """Response functionality from Telegram Bot Api.""" import jsonpickle import telegrambotapiwrapper.typelib as types_module from telegrambotapiwrapper.annotation import AnnotationWrapper from telegrambotapiwrapper.errors import UnsuccessfulRequest from t...
# -*- coding: utf-8 -*- # Copyright (c) 2019 <NAME>; MIT License """Response functionality from Telegram Bot Api.""" import jsonpickle import telegrambotapiwrapper.typelib as types_module from telegrambotapiwrapper.annotation import AnnotationWrapper from telegrambotapiwrapper.errors import UnsuccessfulRequest from t...
en
0.523162
# -*- coding: utf-8 -*- # Copyright (c) 2019 <NAME>; MIT License Response functionality from Telegram Bot Api. Is value str, int, float, bool. Get a json-like dict from the dataclass fields. Replace recursive keys in the object from to from_. Convert object to api type Convert the result of the request to the Teleg...
2.799906
3
circuits/tools/__init__.py
spaceone/circuits
0
6624914
<gh_stars>0 """Circuits Tools circuits.tools contains a standard set of tools for circuits. These tools are installed as executables with a prefix of "circuits." """ import inspect as _inspect from functools import wraps from warnings import warn, warn_explicit from circuits.six import _func_code def tryimport(modu...
"""Circuits Tools circuits.tools contains a standard set of tools for circuits. These tools are installed as executables with a prefix of "circuits." """ import inspect as _inspect from functools import wraps from warnings import warn, warn_explicit from circuits.six import _func_code def tryimport(modules, obj=Non...
en
0.81707
Circuits Tools circuits.tools contains a standard set of tools for circuits. These tools are installed as executables with a prefix of "circuits." Display a directed graph of the Component structure of x :param x: A Component or Manager to graph :type x: Component or Manager :param name: A name for the ...
2.573513
3
docusign_esign/models/contact.py
pivotal-energy-solutions/docusign-python-client
0
6624915
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. OpenAPI spec version: v2 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pfor...
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. OpenAPI spec version: v2 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pfor...
en
0.733636
# coding: utf-8 DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. OpenAPI spec version: v2 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git NOTE: This class is auto generated by ...
1.958006
2
autogl/module/model/decoders/__init__.py
dedsec-9/AutoGL
0
6624916
<reponame>dedsec-9/AutoGL from .base_decoder import BaseDecoderMaintainer from .decoder_registry import DecoderUniversalRegistry from autogl.backend import DependentBackend if DependentBackend.is_pyg(): from ._pyg import ( LogSoftmaxDecoderMaintainer, SumPoolMLPDecoderMaintainer, DiffPoolDe...
from .base_decoder import BaseDecoderMaintainer from .decoder_registry import DecoderUniversalRegistry from autogl.backend import DependentBackend if DependentBackend.is_pyg(): from ._pyg import ( LogSoftmaxDecoderMaintainer, SumPoolMLPDecoderMaintainer, DiffPoolDecoderMaintainer, D...
none
1
1.797511
2
.venv/lib/python3.8/site-packages/sympy/polys/domains/gmpyrationalfield.py
RivtLib/replit01
603
6624917
<filename>.venv/lib/python3.8/site-packages/sympy/polys/domains/gmpyrationalfield.py """Implementation of :class:`GMPYRationalField` class. """ from sympy.polys.domains.groundtypes import ( GMPYRational, SymPyRational, gmpy_numer, gmpy_denom, gmpy_factorial, ) from sympy.polys.domains.rationalfield import Rat...
<filename>.venv/lib/python3.8/site-packages/sympy/polys/domains/gmpyrationalfield.py """Implementation of :class:`GMPYRationalField` class. """ from sympy.polys.domains.groundtypes import ( GMPYRational, SymPyRational, gmpy_numer, gmpy_denom, gmpy_factorial, ) from sympy.polys.domains.rationalfield import Rat...
en
0.585749
Implementation of :class:`GMPYRationalField` class. Rational field based on GMPY's ``mpq`` type. This will be the implementation of :ref:`QQ` if ``gmpy`` or ``gmpy2`` is installed. Elements will be of type ``gmpy.mpq``. Returns ring associated with ``self``. Convert ``a`` to a SymPy object. Convert SymPy's Int...
2.348285
2
gamebeater/profiles/forms.py
GTmmiller/gamebeater
1
6624918
from django import forms from django.contrib.auth.models import User from .statuses import CompletionStatus from .models import GameOwnership, Goal class UserForm(forms.ModelForm): password = forms.CharField(widget=forms.PasswordInput()) class Meta: model = User fields = ('username', 'email', 'password') cl...
from django import forms from django.contrib.auth.models import User from .statuses import CompletionStatus from .models import GameOwnership, Goal class UserForm(forms.ModelForm): password = forms.CharField(widget=forms.PasswordInput()) class Meta: model = User fields = ('username', 'email', 'password') cl...
none
1
2.042032
2
test/sql/test_defaults.py
lxl0928/timi_sqlalchemy
1
6624919
<reponame>lxl0928/timi_sqlalchemy<filename>test/sql/test_defaults.py<gh_stars>1-10 import datetime import itertools import sqlalchemy as sa from sqlalchemy import Boolean from sqlalchemy import cast from sqlalchemy import DateTime from sqlalchemy import exc from sqlalchemy import ForeignKey from sqlalchemy import func...
import datetime import itertools import sqlalchemy as sa from sqlalchemy import Boolean from sqlalchemy import cast from sqlalchemy import DateTime from sqlalchemy import exc from sqlalchemy import ForeignKey from sqlalchemy import func from sqlalchemy import Integer from sqlalchemy import literal from sqlalchemy impo...
en
0.763762
# note: that the datatype is an Integer here doesn't matter, # the server_default is interpreted independently of the # column's datatype. CREATE TABLE t (x INTEGER DEFAULT '5 '' 8') # ensure a "close()" on this connection does nothing, # since its a "branched" connection # select "count(1)" returns different results o...
2.367274
2
tools/pa_init_input.py
minyez/mykit
4
6624920
<reponame>minyez/mykit<gh_stars>1-10 #!/usr/bin/env python # coding=utf-8 # ==================================================== # File Name : pa_init_input.py # Creation Date : 18-04-2018 # Created By : <NAME> # Contact : <EMAIL> # ==================================================== from pa_classes imp...
#!/usr/bin/env python # coding=utf-8 # ==================================================== # File Name : pa_init_input.py # Creation Date : 18-04-2018 # Created By : <NAME> # Contact : <EMAIL> # ==================================================== from pa_classes import abinit_input_files from argparse ...
en
0.425012
#!/usr/bin/env python # coding=utf-8 # ==================================================== # File Name : pa_init_input.py # Creation Date : 18-04-2018 # Created By : <NAME> # Contact : <EMAIL> # ==================================================== # ==================================================== Ini...
2.508392
3
AO3/users.py
gf0507033/ao3_api
0
6624921
<reponame>gf0507033/ao3_api<filename>AO3/users.py import datetime from cached_property import cached_property import requests from bs4 import BeautifulSoup from . import threadable, utils from .requester import requester class User: """ AO3 user object """ def __init__(self, username...
import datetime from cached_property import cached_property import requests from bs4 import BeautifulSoup from . import threadable, utils from .requester import requester class User: """ AO3 user object """ def __init__(self, username, session=None, load=True): """Creates a ...
en
0.760632
AO3 user object Creates a new AO3 user object Args: username (str): AO3 username session (AO3.Session, optional): Used to access additional info load (bool, optional): If true, the user is loaded on initialization. Defaults to True. Sets the session used to make request...
2.750346
3
src/utils/formatter.py
XxKavosxX/consumption_data_analysis
0
6624922
<filename>src/utils/formatter.py<gh_stars>0 import numpy as np import pandas as pd from datetime import timedelta from itertools import groupby, count G22 = 1760/(22*1000) G47 = 1760/(47*1000) G82 = 1760/(82*1000) def dt_remover(df): indice = count() zipped = zip(df.index, indice) lst = [(date - timed...
<filename>src/utils/formatter.py<gh_stars>0 import numpy as np import pandas as pd from datetime import timedelta from itertools import groupby, count G22 = 1760/(22*1000) G47 = 1760/(47*1000) G82 = 1760/(82*1000) def dt_remover(df): indice = count() zipped = zip(df.index, indice) lst = [(date - timed...
none
1
2.438276
2
mancala/mancala.py
jaywon99/mancala
0
6624923
# -*- coding: utf-8 -*- '''Mancala Board https://www.thesprucecrafts.com/how-to-play-mancala-409424 ''' import pickle class DistributeIterator: def __init__(self, order, start, nth): self.order = order self.start = start self.nth = nth self.pos = 0 def _go_next(self): ...
# -*- coding: utf-8 -*- '''Mancala Board https://www.thesprucecrafts.com/how-to-play-mancala-409424 ''' import pickle class DistributeIterator: def __init__(self, order, start, nth): self.order = order self.start = start self.nth = nth self.pos = 0 def _go_next(self): ...
en
0.918295
# -*- coding: utf-8 -*- Mancala Board https://www.thesprucecrafts.com/how-to-play-mancala-409424 # final # final # final # final # almost final (just 1 set) # ERROR! FOUL! You can pick from your pits only. # ERROR! FOUL! You should pick pit which stone exist. # pick up stones # Rule #04: The game begins with one player...
3.992585
4
pf-net/shapenet_part_loader.py
63445538/Contrib
0
6624924
# from __future__ import print_function import paddle.fluid as fluid import os import os.path import json import numpy as np import sys BASE_DIR = os.path.dirname(os.path.abspath(__file__)) dataset_path = os.path.abspath( os.path.join(BASE_DIR, 'dataset/shapenet_part/shapenetcore_partanno_segmentation_benchmark_v0...
# from __future__ import print_function import paddle.fluid as fluid import os import os.path import json import numpy as np import sys BASE_DIR = os.path.dirname(os.path.abspath(__file__)) dataset_path = os.path.abspath( os.path.join(BASE_DIR, 'dataset/shapenet_part/shapenetcore_partanno_segmentation_benchmark_v0...
en
0.227624
# from __future__ import print_function # print(self.cat) # print('category', item) # print(dir_point, dir_seg) # print(self.num_seg_classes) # cls = np.array([cls]).astype(np.int32) # print(point_set.shape, seg.shape) # resample # To Pytorch # point_set = torch.from_numpy(point_set) # seg = torch.from_numpy...
2.403304
2
pay-api/src/pay_api/models/payment_account.py
thorwolpert/sbc-pay
0
6624925
# Copyright © 2019 Province of British Columbia # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
# Copyright © 2019 Province of British Columbia # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
en
0.838562
# Copyright © 2019 Province of British Columbia # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
2.20907
2
vonenet/params.py
comeeasy/VOneNet_FGSM_MNIST
3
6624926
<filename>vonenet/params.py import numpy as np from .utils import sample_dist import scipy.stats as stats def generate_gabor_param(features, seed=0, rand_flag=False, sf_corr=0, sf_max=9, sf_min=0): # Generates random sample np.random.seed(seed) phase_bins = np.array([0, 360]) phase_dist = np.array([...
<filename>vonenet/params.py import numpy as np from .utils import sample_dist import scipy.stats as stats def generate_gabor_param(features, seed=0, rand_flag=False, sf_corr=0, sf_max=9, sf_min=0): # Generates random sample np.random.seed(seed) phase_bins = np.array([0, 360]) phase_dist = np.array([...
en
0.338014
# Generates random sample # sf_bins = np.array([0.5, 8]) # sf_dist = np.array([1]) # DeValois 1982a # Schiller 1976 # Ringach 2002b # DeValois 1982b
2.31737
2
networks.py
vish119/Neural-Network-for-XOR-and-Binary-Image-Classification
0
6624927
# sample_submission.py import numpy as np from scipy.special import expit import sys class xor_net(object): """ This code will train and test the Neural Network for XOR data. Args: data: Is a tuple, ``(x,y)`` ``x`` is a two or one dimensional ndarray ordered such that axis 0 is ind...
# sample_submission.py import numpy as np from scipy.special import expit import sys class xor_net(object): """ This code will train and test the Neural Network for XOR data. Args: data: Is a tuple, ``(x,y)`` ``x`` is a two or one dimensional ndarray ordered such that axis 0 is ind...
en
0.87454
# sample_submission.py This code will train and test the Neural Network for XOR data. Args: data: Is a tuple, ``(x,y)`` ``x`` is a two or one dimensional ndarray ordered such that axis 0 is independent data and data is spread along axis 1. If the array had only one dimension, i...
3.585412
4
ibm_db_django/jybase.py
SabaKauser/python-ibmdb-django
0
6624928
<filename>ibm_db_django/jybase.py # +--------------------------------------------------------------------------+ # | Licensed Materials - Property of IBM | # | | # | (C) Copyright IBM Corporation 2009-2017. ...
<filename>ibm_db_django/jybase.py # +--------------------------------------------------------------------------+ # | Licensed Materials - Property of IBM | # | | # | (C) Copyright IBM Corporation 2009-2017. ...
en
0.710044
# +--------------------------------------------------------------------------+ # | Licensed Materials - Property of IBM | # | | # | (C) Copyright IBM Corporation 2009-2017. |...
1.514403
2
tests/test_dtmp.py
rcurrie/rest-template
0
6624929
import requests server = "http://localhost:5000/" def test_hello(): """ Test hello endpoint """ r = requests.get(server + "hello") assert(r.status_code == requests.codes.ok) assert(r.text == "hello")
import requests server = "http://localhost:5000/" def test_hello(): """ Test hello endpoint """ r = requests.get(server + "hello") assert(r.status_code == requests.codes.ok) assert(r.text == "hello")
en
0.311012
Test hello endpoint
2.83812
3
spark_auto_mapper_fhir/value_sets/table_cell_scope.py
imranq2/SparkAutoMapper.FHIR
1
6624930
<filename>spark_auto_mapper_fhir/value_sets/table_cell_scope.py from __future__ import annotations from spark_auto_mapper_fhir.fhir_types.uri import FhirUri from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType ...
<filename>spark_auto_mapper_fhir/value_sets/table_cell_scope.py from __future__ import annotations from spark_auto_mapper_fhir.fhir_types.uri import FhirUri from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType ...
en
0.360376
# This file is auto-generated by generate_classes so do not edit manually # noinspection PyPep8Naming v3.TableCellScope From: http://terminology.hl7.org/ValueSet/v3-TableCellScope in v3-codesystems.xml These values are defined within the XHTML 4.0 Table Model http://terminology.hl7.org/CodeSystem/v3-TableC...
1.900437
2
monitor/tests/test_models/test_tweet_response.py
arineto/twitter_monitor
1
6624931
<reponame>arineto/twitter_monitor from django.test import TestCase from model_mommy import mommy class TestTweetResponse(TestCase): def setUp(self): self.response = mommy.make('monitor.TweetResponse') def test__str__(self): self.assertEqual( str(self.response), '{} ({...
from django.test import TestCase from model_mommy import mommy class TestTweetResponse(TestCase): def setUp(self): self.response = mommy.make('monitor.TweetResponse') def test__str__(self): self.assertEqual( str(self.response), '{} ({})'.format(str(self.response.user)...
none
1
2.563984
3
zerver/tornado/event_queue.py
narendrapsgim/zulip
17,004
6624932
# See https://zulip.readthedocs.io/en/latest/subsystems/events-system.html for # high-level documentation on how this system works. import atexit import copy import logging import os import random import signal import sys import time import traceback from collections import deque from dataclasses import asdict from typ...
# See https://zulip.readthedocs.io/en/latest/subsystems/events-system.html for # high-level documentation on how this system works. import atexit import copy import logging import os import random import signal import sys import time import traceback from collections import deque from dataclasses import asdict from typ...
en
0.90359
# See https://zulip.readthedocs.io/en/latest/subsystems/events-system.html for # high-level documentation on how this system works. # The idle timeout used to be a week, but we found that in that # situation, queues from dead browser sessions would grow quite large # due to the accumulation of message data in those que...
1.67082
2
utilities/configuration.py
merretbuurman/rapydo-utils
0
6624933
# -*- coding: utf-8 -*- # import os from utilities import PROJECT_CONF_FILENAME, PROJECTS_DEFAULTS_FILE from utilities.myyaml import load_yaml_file from utilities.logs import get_logger log = get_logger(__name__) # SCRIPT_PATH = helpers.script_abspath(__file__) def load_project_configuration(project_path): arg...
# -*- coding: utf-8 -*- # import os from utilities import PROJECT_CONF_FILENAME, PROJECTS_DEFAULTS_FILE from utilities.myyaml import load_yaml_file from utilities.logs import get_logger log = get_logger(__name__) # SCRIPT_PATH = helpers.script_abspath(__file__) def load_project_configuration(project_path): arg...
en
0.561383
# -*- coding: utf-8 -*- # import os # SCRIPT_PATH = helpers.script_abspath(__file__) Read default configuration # DEFAULT # 'path': SCRIPT_PATH, # CUSTOM FROM THE USER # Recover the two options # Verify custom project configuration # Check if these three variables were changed from the initial template # get file name ...
2.427654
2
cn/study/days100/days016/05SeqSearch.py
Jasonandy/Python-X
0
6624934
<filename>cn/study/days100/days016/05SeqSearch.py<gh_stars>0 """ 顺序查找 """ from time import time def seq_search(items, key): """顺序查找""" for index, item in enumerate(items): if item == key: return index return -1 def main(): origin = [1, 22, 13, 34, 55, 26, 12, 32, 32, 23, 45, 34, ...
<filename>cn/study/days100/days016/05SeqSearch.py<gh_stars>0 """ 顺序查找 """ from time import time def seq_search(items, key): """顺序查找""" for index, item in enumerate(items): if item == key: return index return -1 def main(): origin = [1, 22, 13, 34, 55, 26, 12, 32, 32, 23, 45, 34, ...
none
1
2.839732
3
tags/1.0.1/ipaddr_test.py
nouiz/fredericbastien-ipaddr-py-speed-up
2
6624935
<reponame>nouiz/fredericbastien-ipaddr-py-speed-up #!/usr/bin/python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LIC...
#!/usr/bin/python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
en
0.820111
#!/usr/bin/python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
2.344627
2
Main/image_net_scraping.py
DominiquePaul/iwi-image-classifier
0
6624936
import numpy as np from preprocessing import create_imagenet_dataset, create_imagenet_dataset_random SIZE = 2000 synset_ids = ["n03051540", "n03051540"] object_names = ["fashion","automotive"] for synset_id, object in zip(synset_ids, object_names): print("Starting to process the {} dataset".format(object)) ...
import numpy as np from preprocessing import create_imagenet_dataset, create_imagenet_dataset_random SIZE = 2000 synset_ids = ["n03051540", "n03051540"] object_names = ["fashion","automotive"] for synset_id, object in zip(synset_ids, object_names): print("Starting to process the {} dataset".format(object)) ...
none
1
2.439271
2
sumo_docker_pipeline/pipeline.py
Kensuke-Mitsuzawa/sumo_docker_pipeline
0
6624937
import typing import joblib from datetime import datetime from pathlib import Path from typing import Optional from sumo_docker_pipeline.logger_unit import logger from sumo_docker_pipeline.operation_module.docker_operation_module import SumoDockerController from sumo_docker_pipeline.operation_module.local_operation_mod...
import typing import joblib from datetime import datetime from pathlib import Path from typing import Optional from sumo_docker_pipeline.logger_unit import logger from sumo_docker_pipeline.operation_module.docker_operation_module import SumoDockerController from sumo_docker_pipeline.operation_module.local_operation_mod...
en
0.566211
# end if A pipeline interface to run SUMO-docker. Args: path_working_dir: a path to save tmp files. n_jobs: the number of cores. # todo move Template2SuMoConfig to other module. # self.template_generator = Template2SuMoConfig(path_config_file=str(path_config_file), # ...
2.09809
2
Collections-a-installer/community-general-2.4.0/plugins/modules/influxdb_user.py
d-amien-b/simple-getwordpress
22
6624938
#!/usr/bin/python # Copyright: (c) 2017, <NAME> <zhhuta () gmail.com> # insipred by <NAME> <kamil.szczygiel () intel.com> influxdb_database module # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass_...
#!/usr/bin/python # Copyright: (c) 2017, <NAME> <zhhuta () gmail.com> # insipred by <NAME> <kamil.szczygiel () intel.com> influxdb_database module # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass_...
en
0.609968
#!/usr/bin/python # Copyright: (c) 2017, <NAME> <zhhuta () gmail.com> # insipred by <NAME> <kamil.szczygiel () intel.com> influxdb_database module # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) --- module: influxdb_user short_description: Manage InfluxDB users description: ...
2.164463
2
EyeReader.py
dupriest/EyeReader
0
6624939
<filename>EyeReader.py<gh_stars>0 from __future__ import print_function import json import urlparse import time from datetime import datetime from eyex.api import EyeXInterface, SampleGaze, SampleFixation from pywinauto import Application import Queue import webbrowser from collections import namedtuple import pywinaut...
<filename>EyeReader.py<gh_stars>0 from __future__ import print_function import json import urlparse import time from datetime import datetime from eyex.api import EyeXInterface, SampleGaze, SampleFixation from pywinauto import Application import Queue import webbrowser from collections import namedtuple import pywinaut...
en
0.68934
# NAMED TUPLES ############################################################################################### # GLOBAL VARIABLES ########################################################################################### # Return program start in path # Opens Bookshelf.txt # path goes up a level from program files fol...
2.314481
2
eekhoorn/tests/test_sql.py
aether-space/eekhoorn
0
6624940
<reponame>aether-space/eekhoorn # encoding: utf-8 try: import unittest2 as unittest except ImportError: import unittest from eekhoorn.sql import statement_finished class SqlTest(unittest.TestCase): def test_finished(self): sql = "SELECT * FROM spam WHERE eggs LIKE '%';" self.assertTrue(s...
# encoding: utf-8 try: import unittest2 as unittest except ImportError: import unittest from eekhoorn.sql import statement_finished class SqlTest(unittest.TestCase): def test_finished(self): sql = "SELECT * FROM spam WHERE eggs LIKE '%';" self.assertTrue(statement_finished(sql)) def...
en
0.83829
# encoding: utf-8
3.146009
3
tests/my_test.py
dosemeion/mmdetection-hqd
0
6624941
import torch # import numpy as np from mmdet.models.necks.yolo_neck_shuffle_cat import ShuffleCatNeck device = torch.device('cuda:0') x1 = torch.rand(1, 1024, 20, 20).to(device) x2 = torch.rand(1, 512, 40, 40).to(device) x3 = torch.rand(1, 256, 80, 80).to(device) in_channels = [1024, 512, 256] out_channel...
import torch # import numpy as np from mmdet.models.necks.yolo_neck_shuffle_cat import ShuffleCatNeck device = torch.device('cuda:0') x1 = torch.rand(1, 1024, 20, 20).to(device) x2 = torch.rand(1, 512, 40, 40).to(device) x3 = torch.rand(1, 256, 80, 80).to(device) in_channels = [1024, 512, 256] out_channel...
en
0.786256
# import numpy as np
2.559075
3
src/py/devops_tools/__init__.py
StatisKit/license
6
6624942
## Copyright [2017] UMR MISTEA INRA, UMR LEPSE INRA, UMR <NAME>, ## ## EPI Virtual Plants Inria ## ## ## ## This file is part of the StatisKit project. More information can be ## ## found at ...
## Copyright [2017] UMR MISTEA INRA, UMR LEPSE INRA, UMR <NAME>, ## ## EPI Virtual Plants Inria ## ## ## ## This file is part of the StatisKit project. More information can be ## ## found at ...
en
0.719173
## Copyright [2017] UMR MISTEA INRA, UMR LEPSE INRA, UMR <NAME>, ## ## EPI Virtual Plants Inria ## ## ## ## This file is part of the StatisKit project. More information can be ## ## found at ...
1.174388
1
0x0F-python-object_relational_mapping/13-model_state_delete_a.py
darkares23/holbertonschool-higher_level_programming
0
6624943
<filename>0x0F-python-object_relational_mapping/13-model_state_delete_a.py<gh_stars>0 #!/usr/bin/python3 """ script that lists all State objects from the database hbtn_0e_6_usa """ import sys from model_state import Base, State from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker if __name__ ...
<filename>0x0F-python-object_relational_mapping/13-model_state_delete_a.py<gh_stars>0 #!/usr/bin/python3 """ script that lists all State objects from the database hbtn_0e_6_usa """ import sys from model_state import Base, State from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker if __name__ ...
en
0.619502
#!/usr/bin/python3 script that lists all State objects from the database hbtn_0e_6_usa
2.502853
3
fourpisky/utils.py
4pisky/fourpisky-core
2
6624944
""" Misc. convenience routines. """ import os import string from collections import Sequence from ephem import Equatorial, J2000 from fourpisky.visibility import DEG_PER_RADIAN import voeventparse import logging logger = logging.getLogger(__name__) def listify(x): """ Returns [x] if x is not already a list. ...
""" Misc. convenience routines. """ import os import string from collections import Sequence from ephem import Equatorial, J2000 from fourpisky.visibility import DEG_PER_RADIAN import voeventparse import logging logger = logging.getLogger(__name__) def listify(x): """ Returns [x] if x is not already a list. ...
en
0.571937
Misc. convenience routines. Returns [x] if x is not already a list. Used to make functions accept either scalar or array inputs - simply `listify` a variable to make sure it's in list format. Ensure parent directory exists, so you can write to `filename`. Unit-checked conversion from voeventparse.Position2D ->...
2.823692
3
KerasManip/ex-datagen-std.py
shamanenas/learning-cnn
0
6624945
<filename>KerasManip/ex-datagen-std.py # The three main types of pixel scaling techniques supported by the ImageDataGenerator class are as follows: # - Pixel Normalization: scale pixel values to the range 0-1. # - Pixel Centering: scale pixel values to have a zero mean. # - Pixel Standardization: scale pixel values to...
<filename>KerasManip/ex-datagen-std.py # The three main types of pixel scaling techniques supported by the ImageDataGenerator class are as follows: # - Pixel Normalization: scale pixel values to the range 0-1. # - Pixel Centering: scale pixel values to have a zero mean. # - Pixel Standardization: scale pixel values to...
en
0.655616
# The three main types of pixel scaling techniques supported by the ImageDataGenerator class are as follows: # - Pixel Normalization: scale pixel values to the range 0-1. # - Pixel Centering: scale pixel values to have a zero mean. # - Pixel Standardization: scale pixel values to have a zero mean and unit variance. # S...
3.584901
4
docs/conf.py
jmarrec/kiva
10
6624946
import sys import os import shlex from recommonmark.parser import CommonMarkParser from datetime import datetime from subprocess import Popen, PIPE def get_version(): """ Returns project version as string from 'git describe' command. """ pipe = Popen('git describe --tags --always', stdout=PIPE, shell=T...
import sys import os import shlex from recommonmark.parser import CommonMarkParser from datetime import datetime from subprocess import Popen, PIPE def get_version(): """ Returns project version as string from 'git describe' command. """ pipe = Popen('git describe --tags --always', stdout=PIPE, shell=T...
en
0.597564
Returns project version as string from 'git describe' command. #html_split_index = True #html_theme_options = {'collapsiblesidebar': True}
2.175089
2
tests/utilities/test_print_schema.py
jhgg/graphql-core
1
6624947
<gh_stars>1-10 from typing import cast, Any, Dict from graphql.language import DirectiveLocation from graphql.type import ( GraphQLArgument, GraphQLBoolean, GraphQLEnumType, GraphQLField, GraphQLFloat, GraphQLInputObjectType, GraphQLInt, GraphQLInterfaceType, GraphQLList, GraphQ...
from typing import cast, Any, Dict from graphql.language import DirectiveLocation from graphql.type import ( GraphQLArgument, GraphQLBoolean, GraphQLEnumType, GraphQLField, GraphQLFloat, GraphQLInputObjectType, GraphQLInt, GraphQLInterfaceType, GraphQLList, GraphQLNonNull, G...
en
0.671351
# keep print_schema and build_schema in sync type Query { singleField: String } type Query { singleField: [String] } type Query { singleField: String! } type Query { singleField: [String]! } type Query { ...
2.128886
2
nzme_skynet/core/controls/text.py
MilindThakur/nzme-skynet
2
6624948
# coding=utf-8 from nzme_skynet.core.controls.clickabletext import ClickableText class Text(ClickableText): pass
# coding=utf-8 from nzme_skynet.core.controls.clickabletext import ClickableText class Text(ClickableText): pass
en
0.644078
# coding=utf-8
1.167954
1
PythonDocs/src/023.py
Bean-jun/LearnGuide
1
6624949
from contextlib import contextmanager @contextmanager def func(): print("我又开始了~") try: yield 1 finally: print("完事了~, 看") if __name__ == '__main__': with func() as f: print(f)
from contextlib import contextmanager @contextmanager def func(): print("我又开始了~") try: yield 1 finally: print("完事了~, 看") if __name__ == '__main__': with func() as f: print(f)
none
1
2.575056
3
data_preprocess/TREC2014.py
CHIANGEL/GraphCM
6
6624950
<gh_stars>1-10 # !/usr/bin/python # coding: utf8 from xml.dom.minidom import parse import xml.dom.minidom import time import pprint import string import sys sys.path.append("..") import argparse import re import os import numpy as np import torch import torch.nn as nn from utils import * from math import log import ra...
# !/usr/bin/python # coding: utf8 from xml.dom.minidom import parse import xml.dom.minidom import time import pprint import string import sys sys.path.append("..") import argparse import re import os import numpy as np import torch import torch.nn as nn from utils import * from math import log import random import jso...
en
0.631102
# !/usr/bin/python # coding: utf8 #$%^&*()_+-=|\';":/.,?><~·!@#¥%……&*()——+-=“:’;、。,?》《{}' # generate infos_per_session # get the session id # print('session: {}'.format(session_number)) # Get topic id # Get information within a query # Get query/document infomation # Sanity check # more than 10 docs is not ok. May caus...
2.202119
2