hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
02d3b99b3066c70d70fba19a24a571cc6bbe89d8 | 4,045 | py | Python | util/validators.py | Eising/viconf | 56b80e340a173dcba013e2c4f6568a1407d418a2 | [
"MIT"
] | 3 | 2018-07-13T12:50:37.000Z | 2018-07-13T22:43:49.000Z | util/validators.py | Eising/viconf | 56b80e340a173dcba013e2c4f6568a1407d418a2 | [
"MIT"
] | null | null | null | util/validators.py | Eising/viconf | 56b80e340a173dcba013e2c4f6568a1407d418a2 | [
"MIT"
] | null | null | null | import re
from django.core.exceptions import ValidationError
| 38.894231 | 121 | 0.454388 | import re
from django.core.exceptions import ValidationError
class ViconfValidators:
VALIDATORS = {
'none': {'description': 'No validation',
'type': 'novalidation'},
'string': {
'description': "Basic String Validation",
'css_class': 'validatestring',
... | 956 | 2,927 | 99 |
df4cd142ea29c514dd5e88d3e9e19bc25ec83409 | 911 | py | Python | pyga/__init__.py | jorahn/gapy-tools | 60ce9e0926a8dab3df5280e4e62b5b4e02675c77 | [
"MIT"
] | null | null | null | pyga/__init__.py | jorahn/gapy-tools | 60ce9e0926a8dab3df5280e4e62b5b4e02675c77 | [
"MIT"
] | 5 | 2021-09-07T08:16:21.000Z | 2021-09-07T08:17:52.000Z | pyga/__init__.py | jorahn/pyga | 60ce9e0926a8dab3df5280e4e62b5b4e02675c77 | [
"MIT"
] | null | null | null | from apiclient.discovery import build
from oauth2client.service_account import ServiceAccountCredentials
SCOPES = ['https://www.googleapis.com/auth/analytics.readonly']
| 36.44 | 72 | 0.605928 | from apiclient.discovery import build
from oauth2client.service_account import ServiceAccountCredentials
SCOPES = ['https://www.googleapis.com/auth/analytics.readonly']
class Client(object):
def __init__(self, credentials_path, ga_view_id):
sac = ServiceAccountCredentials.from_json_keyfile_name(
... | 657 | 0 | 84 |
97edc50aa290d68498f9a97992c3b2615ec35c47 | 1,069 | py | Python | Criminals/datasetCreator.py | DaveSoham08/CamRadar | 0a801445b060d17c27eed9153accd4d3f4f0ec18 | [
"MIT"
] | 3 | 2021-11-16T23:56:19.000Z | 2022-03-31T12:01:21.000Z | Criminals/datasetCreator.py | DaveSoham08/CamRadar | 0a801445b060d17c27eed9153accd4d3f4f0ec18 | [
"MIT"
] | 2 | 2020-10-01T10:08:35.000Z | 2020-10-15T09:52:31.000Z | Criminals/datasetCreator.py | DaveSoham08/CamRadar | 0a801445b060d17c27eed9153accd4d3f4f0ec18 | [
"MIT"
] | 4 | 2020-10-01T10:20:24.000Z | 2021-08-06T15:46:55.000Z | import cv2
import os
face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')
cam = cv2.VideoCapture(0)
id = input('enter Name: ')
createFolder('./'+str(id)+'/')
FaceCount=1
while(True):
ret,img = cam.read()
gray=cv2.cvtColor(img,cv2.COLOR_B... | 23.23913 | 99 | 0.613658 | import cv2
import os
face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')
cam = cv2.VideoCapture(0)
id = input('enter Name: ')
def createFolder(directory):
try:
if not os.path.exists(directory):
os.makedirs(directory)
except OSError:
... | 172 | 0 | 23 |
8258d599493da8993df7590f9b6a50103b24a974 | 17,343 | py | Python | axiom/drs/__init__.py | AusClimateService/axiom | 24678093065a4626549831086e4903e38f60fa81 | [
"MIT"
] | null | null | null | axiom/drs/__init__.py | AusClimateService/axiom | 24678093065a4626549831086e4903e38f60fa81 | [
"MIT"
] | 8 | 2022-03-16T12:08:12.000Z | 2022-03-29T03:17:47.000Z | axiom/drs/__init__.py | AusClimateService/axiom | 24678093065a4626549831086e4903e38f60fa81 | [
"MIT"
] | null | null | null | """Main entrypoint for DRS processing."""
import os
import argparse
from datetime import datetime
from uuid import uuid4
import xarray as xr
import axiom.utilities as au
import axiom.drs.utilities as adu
from axiom.drs.domain import Domain
import axiom_schemas as axs
import json
import sys
from distributed import Clien... | 34.895372 | 149 | 0.655019 | """Main entrypoint for DRS processing."""
import os
import argparse
from datetime import datetime
from uuid import uuid4
import xarray as xr
import axiom.utilities as au
import axiom.drs.utilities as adu
from axiom.drs.domain import Domain
import axiom_schemas as axs
import json
import sys
from distributed import Clien... | 2,440 | 0 | 79 |
35533e5d962f098795f4df7251d34f1786d292d1 | 2,623 | py | Python | zerver/management/commands/delete_user.py | dumpmemory/zulip | 496273ddbc567330a0022699d6d6eb5c646e5da5 | [
"Apache-2.0"
] | 4 | 2021-09-16T16:46:55.000Z | 2022-02-06T13:00:21.000Z | zerver/management/commands/delete_user.py | dumpmemory/zulip | 496273ddbc567330a0022699d6d6eb5c646e5da5 | [
"Apache-2.0"
] | null | null | null | zerver/management/commands/delete_user.py | dumpmemory/zulip | 496273ddbc567330a0022699d6d6eb5c646e5da5 | [
"Apache-2.0"
] | 1 | 2022-01-15T08:36:09.000Z | 2022-01-15T08:36:09.000Z | from argparse import ArgumentParser
from typing import Any
from django.core.management.base import CommandError
from zerver.actions.users import do_delete_user
from zerver.lib.management import ZulipBaseCommand
from zerver.lib.users import get_active_bots_owned_by_user
| 38.014493 | 108 | 0.707968 | from argparse import ArgumentParser
from typing import Any
from django.core.management.base import CommandError
from zerver.actions.users import do_delete_user
from zerver.lib.management import ZulipBaseCommand
from zerver.lib.users import get_active_bots_owned_by_user
class Command(ZulipBaseCommand):
help = ""... | 1,052 | 1,275 | 23 |
f773fcccc35ee41465b960a9d31de2665891d753 | 16,795 | py | Python | yandex/cloud/containerregistry/v1/repository_service_pb2.py | kbespalov/python-sdk | e86563ee850e46a35b4c84053ecd4affdf66a963 | [
"MIT"
] | null | null | null | yandex/cloud/containerregistry/v1/repository_service_pb2.py | kbespalov/python-sdk | e86563ee850e46a35b4c84053ecd4affdf66a963 | [
"MIT"
] | null | null | null | yandex/cloud/containerregistry/v1/repository_service_pb2.py | kbespalov/python-sdk | e86563ee850e46a35b4c84053ecd4affdf66a963 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: yandex/cloud/containerregistry/v1/repository_service.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import... | 53.148734 | 2,852 | 0.792141 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: yandex/cloud/containerregistry/v1/repository_service.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import... | 0 | 0 | 0 |
23839cfb3ef59b3fee3c12103323e7a4cd3c1750 | 4,507 | py | Python | pdseg/tools/jingling2seg.py | windstamp/PaddleSeg | 828808ea306adf2e8b94c291b77e7b7cf558bc2a | [
"ECL-2.0",
"Apache-2.0"
] | 56 | 2021-01-31T02:19:12.000Z | 2022-03-12T12:39:21.000Z | pdseg/tools/jingling2seg.py | windstamp/PaddleSeg | 828808ea306adf2e8b94c291b77e7b7cf558bc2a | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-07-21T02:36:01.000Z | 2021-07-21T02:37:45.000Z | pdseg/tools/jingling2seg.py | windstamp/PaddleSeg | 828808ea306adf2e8b94c291b77e7b7cf558bc2a | [
"ECL-2.0",
"Apache-2.0"
] | 13 | 2021-02-03T11:18:36.000Z | 2022-03-07T08:18:53.000Z | # coding: utf8
# Copyright (c) 2019 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 requ... | 35.769841 | 79 | 0.575327 | # coding: utf8
# Copyright (c) 2019 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 requ... | 3,534 | 0 | 46 |
6ab0ca7ba55dac6b9331d89b7e1cfee20e535678 | 776 | py | Python | farm_food_project/product/forms.py | BoyanPeychinov/farm_food_project | 1cac80194bb8563b0f1926685a540e3162f43e82 | [
"MIT"
] | null | null | null | farm_food_project/product/forms.py | BoyanPeychinov/farm_food_project | 1cac80194bb8563b0f1926685a540e3162f43e82 | [
"MIT"
] | null | null | null | farm_food_project/product/forms.py | BoyanPeychinov/farm_food_project | 1cac80194bb8563b0f1926685a540e3162f43e82 | [
"MIT"
] | null | null | null | import os
from os.path import join
from django import forms
from django.conf import settings
from farm_food_project.product.models import Product
| 24.25 | 79 | 0.600515 | import os
from os.path import join
from django import forms
from django.conf import settings
from farm_food_project.product.models import Product
class ProductForm(forms.ModelForm):
class Meta:
model = Product
exclude = ('producer_profile',)
class EditProductForm(ProductForm):
def save(sel... | 204 | 377 | 46 |
6f6660d38febf7f7dcd610ea4ab528e6cbc433d9 | 675 | py | Python | planemo/commands/cmd_profile_create.py | gmauro/planemo | 574088f356a7b9f49191daf15437c2973c7318d8 | [
"CC-BY-3.0"
] | 73 | 2015-01-03T15:09:26.000Z | 2022-03-30T23:52:55.000Z | planemo/commands/cmd_profile_create.py | gmauro/planemo | 574088f356a7b9f49191daf15437c2973c7318d8 | [
"CC-BY-3.0"
] | 958 | 2015-01-02T08:27:45.000Z | 2022-03-23T14:51:51.000Z | planemo/commands/cmd_profile_create.py | gmauro/planemo | 574088f356a7b9f49191daf15437c2973c7318d8 | [
"CC-BY-3.0"
] | 84 | 2015-01-06T18:27:28.000Z | 2021-11-18T01:58:17.000Z | """Module describing the planemo ``profile_create`` command."""
from __future__ import print_function
import click
from planemo import options
from planemo.cli import command_function
from planemo.galaxy import profiles
@click.command('profile_create')
@options.profile_name_argument()
@options.profile_database_opti... | 28.125 | 63 | 0.78963 | """Module describing the planemo ``profile_create`` command."""
from __future__ import print_function
import click
from planemo import options
from planemo.cli import command_function
from planemo.galaxy import profiles
@click.command('profile_create')
@options.profile_name_argument()
@options.profile_database_opti... | 0 | 0 | 0 |
94bc87232d071ef45a48f22dec97aecb48383671 | 207 | py | Python | BOJ1920.py | INYEONGKIM/BOJ | 5e83d77a92d18b0d20d26645c7cfe4ba3e2d25bc | [
"MIT"
] | 2 | 2019-03-05T15:42:46.000Z | 2019-07-24T15:52:36.000Z | BOJ1920.py | INYEONGKIM/BOJ | 5e83d77a92d18b0d20d26645c7cfe4ba3e2d25bc | [
"MIT"
] | null | null | null | BOJ1920.py | INYEONGKIM/BOJ | 5e83d77a92d18b0d20d26645c7cfe4ba3e2d25bc | [
"MIT"
] | null | null | null | n=int(input());a=set(int(i) for i in input().split());x=int(input());b=[int(i) for i in input().split()];r=""
for i in range(x):
if b[i] in a:
r+="1\n"
else:
r+="0\n"
print(r,end="")
| 25.875 | 109 | 0.492754 | n=int(input());a=set(int(i) for i in input().split());x=int(input());b=[int(i) for i in input().split()];r=""
for i in range(x):
if b[i] in a:
r+="1\n"
else:
r+="0\n"
print(r,end="")
| 0 | 0 | 0 |
05d3a3fd5713f38eba2b7403a0888a87ccc57c67 | 4,465 | py | Python | edg_core/edgir/name_pb2.py | tengisd/PolymorphicBlocks | 240a11f813762c4eb5a97c9d9766a0af19cd8f3a | [
"BSD-3-Clause"
] | null | null | null | edg_core/edgir/name_pb2.py | tengisd/PolymorphicBlocks | 240a11f813762c4eb5a97c9d9766a0af19cd8f3a | [
"BSD-3-Clause"
] | null | null | null | edg_core/edgir/name_pb2.py | tengisd/PolymorphicBlocks | 240a11f813762c4eb5a97c9d9766a0af19cd8f3a | [
"BSD-3-Clause"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: name.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflecti... | 33.571429 | 350 | 0.745577 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: name.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflecti... | 0 | 0 | 0 |
4d65d97e660f59e6e5c059933d187036a99a95c3 | 2,544 | py | Python | L1Trigger/L1GctAnalyzer/test/gctLUTGenerator_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | L1Trigger/L1GctAnalyzer/test/gctLUTGenerator_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | L1Trigger/L1GctAnalyzer/test/gctLUTGenerator_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | from __future__ import print_function
import FWCore.ParameterSet.Config as cms
import sys
import os
# arguments
if (len(sys.argv)>1) :
key=str(sys.argv[2])
else :
key='Default'
print("Generating LUT files for GCT key %s" % (key))
if (not ("TNS_ADMIN" in os.environ.keys())):
print("Please set TNS_ADMIN u... | 31.8 | 91 | 0.795597 | from __future__ import print_function
import FWCore.ParameterSet.Config as cms
import sys
import os
# arguments
if (len(sys.argv)>1) :
key=str(sys.argv[2])
else :
key='Default'
print("Generating LUT files for GCT key %s" % (key))
if (not ("TNS_ADMIN" in os.environ.keys())):
print("Please set TNS_ADMIN u... | 0 | 0 | 0 |
688901152b667dc7976e5543f38c2819e523404e | 26,813 | py | Python | sdk/python/pulumi_equinix_metal/outputs.py | rawkode/pulumi-equinix-metal | 915d768709ced7d2caed563c1823302f378c4317 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_equinix_metal/outputs.py | rawkode/pulumi-equinix-metal | 915d768709ced7d2caed563c1823302f378c4317 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_equinix_metal/outputs.py | rawkode/pulumi-equinix-metal | 915d768709ced7d2caed563c1823302f378c4317 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # 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
from . import _utilities... | 32.265945 | 225 | 0.601611 | # 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
from . import _utilities... | 4,445 | 20,899 | 308 |
f4a948c6bd4758bab971081aa2c10e3df2792c0e | 4,594 | py | Python | kts/feature/decorators.py | alexander-ahappydandelion/kts_update_v1 | 016ca31b3cf9512730e31f475738e8150cc1ba01 | [
"MIT"
] | null | null | null | kts/feature/decorators.py | alexander-ahappydandelion/kts_update_v1 | 016ca31b3cf9512730e31f475738e8150cc1ba01 | [
"MIT"
] | null | null | null | kts/feature/decorators.py | alexander-ahappydandelion/kts_update_v1 | 016ca31b3cf9512730e31f475738e8150cc1ba01 | [
"MIT"
] | null | null | null | from ..storage import source_utils
from ..storage.caching import cache
from .. import config
from .storage import FeatureConstructor
from ..storage import dataframe
from IPython.display import display
from glob import glob
import os
def preview(df, sizes=(2, 4, 6)):
"""
Applies function to heads of particular... | 29.075949 | 138 | 0.627993 | from ..storage import source_utils
from ..storage.caching import cache
from .. import config
from .storage import FeatureConstructor
from ..storage import dataframe
from IPython.display import display
from glob import glob
import os
def preview(df, sizes=(2, 4, 6)):
"""
Applies function to heads of particular... | 1,128 | 0 | 54 |
18349715cf8def25c13f26d2c461059197972efe | 473 | py | Python | CalibCalorimetry/HcalAlgos/test/HcalPulseContainmentTest_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | CalibCalorimetry/HcalAlgos/test/HcalPulseContainmentTest_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | CalibCalorimetry/HcalAlgos/test/HcalPulseContainmentTest_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("Test")
process.load("Configuration.StandardSequences.Services_cff")
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
process.source = cms.Source("EmptySource")
process.maxEvents = cms.untracked.PSet(
input = cms.untr... | 27.823529 | 80 | 0.813953 | import FWCore.ParameterSet.Config as cms
process = cms.Process("Test")
process.load("Configuration.StandardSequences.Services_cff")
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
process.source = cms.Source("EmptySource")
process.maxEvents = cms.untracked.PSet(
input = cms.untr... | 0 | 0 | 0 |
1b3d6434b2a95decaf3d4646b6d28abd9ee7d364 | 1,745 | py | Python | select_workload.py | tverona1/yb-workload-runner | 6a2200320394f7138ee279842ad0ffb3bcafb98c | [
"Apache-2.0"
] | null | null | null | select_workload.py | tverona1/yb-workload-runner | 6a2200320394f7138ee279842ad0ffb3bcafb98c | [
"Apache-2.0"
] | null | null | null | select_workload.py | tverona1/yb-workload-runner | 6a2200320394f7138ee279842ad0ffb3bcafb98c | [
"Apache-2.0"
] | null | null | null | import logging
import random
from common.timing_wrapper import TimingWrapper
from locust import User, task, between
from common.workload_config import workload_config
""" A simple workload that selects single rows
""" | 36.354167 | 143 | 0.66361 | import logging
import random
from common.timing_wrapper import TimingWrapper
from locust import User, task, between
from common.workload_config import workload_config
""" A simple workload that selects single rows
"""
class SelectWorkload(User):
def __init__(self, environment):
super().__init__(environment... | 1,269 | 236 | 22 |
503acad9c4788c75353acb9d062054aeba556e78 | 7,922 | py | Python | mathutils/test_xform.py | saridut/FloriPy | 0117d358b9c2362ea32ecf9ec719fdaed87d3e14 | [
"MIT"
] | null | null | null | mathutils/test_xform.py | saridut/FloriPy | 0117d358b9c2362ea32ecf9ec719fdaed87d3e14 | [
"MIT"
] | null | null | null | mathutils/test_xform.py | saridut/FloriPy | 0117d358b9c2362ea32ecf9ec719fdaed87d3e14 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import math
import numpy as np
from xform import *
if __name__ == '__main__':
test_axis_angle_conversion()
test_quat_conversion()
test_euler_conversion()
test_dcm_conversion()
test_rot_shift_axis_angle()
test_rot_shift_quat()
test_rot_shift_euler()
test... | 28.599278 | 81 | 0.502903 | #!/usr/bin/env python
import math
import numpy as np
from xform import *
def test_axis_angle_conversion():
print('=====================')
print('axis-angle conversion')
print('=====================')
axes = []; angles = []
axis, angle = get_rand_axis_angle()
axes.append(axis)
angles.append... | 7,353 | 0 | 234 |
76648a1e96a186e36c49d414e4cdff5de252be12 | 1,014 | py | Python | Django/api-basic2/photo/serializers.py | sug5806/TIL | 2309d8a270e4a7b8961268a40b6492c5db317e37 | [
"MIT"
] | null | null | null | Django/api-basic2/photo/serializers.py | sug5806/TIL | 2309d8a270e4a7b8961268a40b6492c5db317e37 | [
"MIT"
] | 102 | 2020-02-12T00:10:33.000Z | 2022-03-11T23:58:41.000Z | Django/api-basic2/photo/serializers.py | sug5806/TIL | 2309d8a270e4a7b8961268a40b6492c5db317e37 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import Photo
| 22.043478 | 57 | 0.657791 | from rest_framework import serializers
from .models import Photo
class PhotoListSerializer(serializers.ModelSerializer):
class Meta:
model = Photo
fields = '__all__'
class PhotoCreateSerializer(serializers.ModelSerializer):
class Meta:
model = Photo
fields = ['text', 'image'... | 282 | 546 | 115 |
dbfbfc640750ada09227ecdd42f47f8bef602d95 | 2,423 | py | Python | saopy/ssn/__init__.py | CityPulse/CP_Resourcemanagement | aa670fa89d5e086a98ade3ccc152518be55abf2e | [
"MIT"
] | 2 | 2016-11-03T14:57:45.000Z | 2019-05-13T13:21:08.000Z | saopy/ssn/__init__.py | CityPulse/CP_Resourcemanagement | aa670fa89d5e086a98ade3ccc152518be55abf2e | [
"MIT"
] | null | null | null | saopy/ssn/__init__.py | CityPulse/CP_Resourcemanagement | aa670fa89d5e086a98ade3ccc152518be55abf2e | [
"MIT"
] | 1 | 2020-07-23T11:27:15.000Z | 2020-07-23T11:27:15.000Z | import saopy.model
from saopy.model import ssn___Accuracy as Accuracy
from saopy.model import ssn___BatteryLifetime as BatteryLifetime
from saopy.model import ssn___Condition as Condition
from saopy.model import ssn___Deployment as Deployment
from saopy.model import ssn___DeploymentRelatedProcess as DeploymentRelatedP... | 55.068182 | 82 | 0.879901 | import saopy.model
from saopy.model import ssn___Accuracy as Accuracy
from saopy.model import ssn___BatteryLifetime as BatteryLifetime
from saopy.model import ssn___Condition as Condition
from saopy.model import ssn___Deployment as Deployment
from saopy.model import ssn___DeploymentRelatedProcess as DeploymentRelatedP... | 0 | 0 | 0 |
04d33ca70ae295d75977a8eeac30643c2d55c981 | 2,023 | py | Python | interview_backend/models.py | LionNatsu/bruh-backend | a85d2265f3806775af59e7efca48138ce8813d7b | [
"BSD-2-Clause"
] | 1 | 2020-03-29T03:35:57.000Z | 2020-03-29T03:35:57.000Z | interview_backend/models.py | LionNatsu/bruh-backend | a85d2265f3806775af59e7efca48138ce8813d7b | [
"BSD-2-Clause"
] | null | null | null | interview_backend/models.py | LionNatsu/bruh-backend | a85d2265f3806775af59e7efca48138ce8813d7b | [
"BSD-2-Clause"
] | null | null | null | from datetime import timedelta
from django.core.validators import MinValueValidator
from django.db import models
from django.contrib.auth.models import User
| 31.609375 | 72 | 0.695007 | from datetime import timedelta
from django.core.validators import MinValueValidator
from django.db import models
from django.contrib.auth.models import User
class Company(models.Model):
name = models.CharField(max_length=64, unique=True)
problems_per_interview = models.IntegerField(
default=3,
... | 0 | 1,697 | 161 |
b3c56f3909af7b042f22cd805a456756f75de739 | 4,393 | py | Python | 16.py | mguenther/advent-of-code-2020 | 6aeb6f80401963b25444d3a9b6e970e28d1ffa37 | [
"Apache-2.0"
] | null | null | null | 16.py | mguenther/advent-of-code-2020 | 6aeb6f80401963b25444d3a9b6e970e28d1ffa37 | [
"Apache-2.0"
] | null | null | null | 16.py | mguenther/advent-of-code-2020 | 6aeb6f80401963b25444d3a9b6e970e28d1ffa37 | [
"Apache-2.0"
] | null | null | null | from functools import reduce
from typing import Callable, Dict, List, Tuple
constraints, my_ticket, nearby_tickets = parse('16.in')
valid_nearby_tickets = []
invalid_number_per_ticket = []
for nearby_ticket in nearby_tickets:
invalid_ticket = False
for number in nearby_ticket:
at_least_one... | 35.715447 | 123 | 0.667425 | from functools import reduce
from typing import Callable, Dict, List, Tuple
def parse_constraints(parser_mode: int) -> bool:
return bool((parser_mode >> 0) & 1)
def parse_my_ticket(parser_mode: int) -> bool:
return bool((parser_mode >> 1) & 1)
def parse_nearby_tickets(parser_mode: int) -> bool:
return... | 3,137 | 0 | 253 |
60d9324b51a93e713fc4c8723c28d7e34049d443 | 4,303 | py | Python | src/hangar/dataloaders/common.py | dxenonb/hangar-py | a47aaf0ab69333e5d2629b231e0f9b4ca835c801 | [
"Apache-2.0"
] | null | null | null | src/hangar/dataloaders/common.py | dxenonb/hangar-py | a47aaf0ab69333e5d2629b231e0f9b4ca835c801 | [
"Apache-2.0"
] | null | null | null | src/hangar/dataloaders/common.py | dxenonb/hangar-py | a47aaf0ab69333e5d2629b231e0f9b4ca835c801 | [
"Apache-2.0"
] | null | null | null | import warnings
from typing import Iterable, Optional, Union, Tuple, List
ArraysetsRef = Union['ArraysetDataReader', Iterable['ArraysetDataReader']]
class GroupedAsets(object):
"""Groups hangar arraysets and validate suitability for usage in dataloaders.
It can choose a subset of samples in the hangar arra... | 36.777778 | 93 | 0.6033 | import warnings
from typing import Iterable, Optional, Union, Tuple, List
ArraysetsRef = Union['ArraysetDataReader', Iterable['ArraysetDataReader']]
class GroupedAsets(object):
"""Groups hangar arraysets and validate suitability for usage in dataloaders.
It can choose a subset of samples in the hangar arra... | 2,125 | 0 | 53 |
e42c5a2d9bff86beb6eecd5c7cdacb2c52adebb8 | 7,017 | py | Python | classify.py | arturx-ml/mushrooms-classification | 8491c5d5f2d87b9e80388e64ab6d4e135199a478 | [
"Apache-2.0",
"MIT"
] | null | null | null | classify.py | arturx-ml/mushrooms-classification | 8491c5d5f2d87b9e80388e64ab6d4e135199a478 | [
"Apache-2.0",
"MIT"
] | null | null | null | classify.py | arturx-ml/mushrooms-classification | 8491c5d5f2d87b9e80388e64ab6d4e135199a478 | [
"Apache-2.0",
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import torch
import torchvision
import numpy as np
from torch import nn
from torch import optim
import torch.nn.functional as F
from torchvision import datasets, transforms, models
from torch.utils.data.sampler import SubsetRandomSampler
import warnings
warnings.filterwarnings('ignore')... | 33.574163 | 120 | 0.587573 | import matplotlib.pyplot as plt
import torch
import torchvision
import numpy as np
from torch import nn
from torch import optim
import torch.nn.functional as F
from torchvision import datasets, transforms, models
from torch.utils.data.sampler import SubsetRandomSampler
import warnings
warnings.filterwarnings('ignore')... | 4,750 | 12 | 192 |
3f74a321c684e580709dd4cc080a97a55640a0e0 | 82 | py | Python | 8_kyu/Enumerable_Magic_25_Take_the_First_N_Elements.py | UlrichBerntien/Codewars-Katas | bbd025e67aa352d313564d3862db19fffa39f552 | [
"MIT"
] | null | null | null | 8_kyu/Enumerable_Magic_25_Take_the_First_N_Elements.py | UlrichBerntien/Codewars-Katas | bbd025e67aa352d313564d3862db19fffa39f552 | [
"MIT"
] | null | null | null | 8_kyu/Enumerable_Magic_25_Take_the_First_N_Elements.py | UlrichBerntien/Codewars-Katas | bbd025e67aa352d313564d3862db19fffa39f552 | [
"MIT"
] | null | null | null | from typing import List | 20.5 | 37 | 0.646341 | from typing import List
def take(arr: List, n: int ) -> List:
return arr[0:n] | 36 | 0 | 23 |
205e7f4b3e86ae8ec174f8e5a7860f421088eac4 | 9,305 | py | Python | game/util/autotile_reformat.py | Sipondo/ulix-dexflow | de46482fe08e3d600dd5da581f0524b55e5df961 | [
"MIT"
] | 5 | 2021-06-25T16:44:38.000Z | 2021-12-31T01:29:00.000Z | game/util/autotile_reformat.py | Sipondo/ulix-dexflow | de46482fe08e3d600dd5da581f0524b55e5df961 | [
"MIT"
] | null | null | null | game/util/autotile_reformat.py | Sipondo/ulix-dexflow | de46482fe08e3d600dd5da581f0524b55e5df961 | [
"MIT"
] | 1 | 2021-06-25T20:33:47.000Z | 2021-06-25T20:33:47.000Z | from pathlib import Path
import os
from PIL import Image, ImageFont
import numpy as np
| 47.233503 | 88 | 0.558947 | from pathlib import Path
import os
from PIL import Image, ImageFont
import numpy as np
def autotile_reformat():
resource_dirs = []
for dir in list(Path("").glob("resources/*/")):
if dir.is_dir():
resource_dirs.append(dir)
for resource_dir in resource_dirs:
p = resource_dir /... | 9,193 | 0 | 23 |
46b3c8427d8f04ad4eb8e154da6dcddeac1bbc94 | 1,301 | py | Python | ShellSort.py | DatHydroGuy/SortVis | 14e539431ed3152b883a9f321c8c166e37b3d513 | [
"MIT"
] | null | null | null | ShellSort.py | DatHydroGuy/SortVis | 14e539431ed3152b883a9f321c8c166e37b3d513 | [
"MIT"
] | null | null | null | ShellSort.py | DatHydroGuy/SortVis | 14e539431ed3152b883a9f321c8c166e37b3d513 | [
"MIT"
] | null | null | null | from SortBase import SortBase
| 32.525 | 99 | 0.544965 | from SortBase import SortBase
class ShellSort(SortBase):
def shell_sort(self, arr):
# Initial sub-array size covers half of the array
n = len(arr)
sub_array_size = n // 2
# Do insertion sort for the sub-array size
# Repeat for smaller sub-array sizes
# Once sub-arr... | 1,189 | 5 | 76 |
529ee3dde960d602ad756f8ede0f45c55d2fdcbd | 2,549 | py | Python | tests/firedrake_backend/test_assemble.py | Naruki-Ichihara/fecr | 5d183f8a316e95fe05ea56a8cc6a16209f471b0d | [
"MIT"
] | 5 | 2020-10-31T10:54:24.000Z | 2021-02-26T12:16:02.000Z | tests/firedrake_backend/test_assemble.py | Naruki-Ichihara/fecr | 5d183f8a316e95fe05ea56a8cc6a16209f471b0d | [
"MIT"
] | 2 | 2020-11-11T15:00:34.000Z | 2021-01-12T20:30:55.000Z | tests/firedrake_backend/test_assemble.py | Naruki-Ichihara/fecr | 5d183f8a316e95fe05ea56a8cc6a16209f471b0d | [
"MIT"
] | 1 | 2022-01-05T14:10:57.000Z | 2022-01-05T14:10:57.000Z | from pytest_check import check
import numpy as np
import firedrake
import firedrake_adjoint
import ufl
import fdm
from fecr import evaluate_primal, evaluate_pullback, evaluate_pushforward
mesh = firedrake.UnitSquareMesh(3, 2)
V = firedrake.FunctionSpace(mesh, "P", 1)
templates = (firedrake.Function(V), firedrak... | 31.469136 | 87 | 0.693213 | from pytest_check import check
import numpy as np
import firedrake
import firedrake_adjoint
import ufl
import fdm
from fecr import evaluate_primal, evaluate_pullback, evaluate_pushforward
mesh = firedrake.UnitSquareMesh(3, 2)
V = firedrake.FunctionSpace(mesh, "P", 1)
def assemble_firedrake(u, kappa0, kappa1):
... | 1,758 | 0 | 92 |
a3ad09b9004548f4bfa2e08739934e7dd51fa329 | 973 | py | Python | codes/20190106/src/test.py | ryoichiro3816/testpy | 3442a3a0281a15d899b0a0b978ea8783f69e3d7b | [
"MIT"
] | 4 | 2020-05-09T22:24:19.000Z | 2021-11-17T02:11:22.000Z | codes/20190106/src/test.py | ryoichiro3816/testpy | 3442a3a0281a15d899b0a0b978ea8783f69e3d7b | [
"MIT"
] | null | null | null | codes/20190106/src/test.py | ryoichiro3816/testpy | 3442a3a0281a15d899b0a0b978ea8783f69e3d7b | [
"MIT"
] | 13 | 2018-02-05T17:36:14.000Z | 2022-03-04T15:26:15.000Z | # coding: utf-8
from PIL import Image
import sys
import pyocr
import pyocr.builders
import os
from tqdm import trange
# Set Netflix subtitle image directory.
img_dir = '../data/planetes/PLANETES.S01E02.WEBRip.Netflix/'
#img_dir = '../data/'
# Get a tool.
tools = pyocr.get_available_tools()
if len(tools) == 0:
print(... | 23.166667 | 83 | 0.694758 | # coding: utf-8
from PIL import Image
import sys
import pyocr
import pyocr.builders
import os
from tqdm import trange
# Set Netflix subtitle image directory.
img_dir = '../data/planetes/PLANETES.S01E02.WEBRip.Netflix/'
#img_dir = '../data/'
# Get a tool.
tools = pyocr.get_available_tools()
if len(tools) == 0:
print(... | 0 | 0 | 0 |
6dbbc657a8e466e3ee6e9fd61f7a2482b069b599 | 869 | py | Python | test/unit_tests/gerneral/test__utils.py | KIC/pandas_utils | 76b764e2f87c2e9bcee9a62cfe0b54e7fb046034 | [
"MIT"
] | 3 | 2019-12-05T11:56:26.000Z | 2021-08-07T08:06:37.000Z | test/unit_tests/gerneral/test__utils.py | KIC/pandas_utils | 76b764e2f87c2e9bcee9a62cfe0b54e7fb046034 | [
"MIT"
] | 6 | 2020-01-23T10:25:13.000Z | 2022-02-10T00:39:27.000Z | test/unit_tests/gerneral/test__utils.py | KIC/pandas_ml_utils | 76b764e2f87c2e9bcee9a62cfe0b54e7fb046034 | [
"MIT"
] | null | null | null | from unittest import TestCase
import numpy as np
from pandas_ml_utils.utils.functions import unfold_parameter_space
from pandas_ml_utils.utils.classes import ReScaler
| 26.333333 | 78 | 0.60069 | from unittest import TestCase
import numpy as np
from pandas_ml_utils.utils.functions import unfold_parameter_space
from pandas_ml_utils.utils.classes import ReScaler
class TestUtils(TestCase):
def test_unfold_parameter_space(self):
"""given"""
parameter_space = {"a": range(3, 6), "b": [1, 2, 3... | 0 | 676 | 23 |
e3167a8a3ecb17a74b3b4d36f893d2185fbb3a1a | 1,030 | py | Python | tests/unit/test_nations.py | Lilykos/scoap3-next | b779b8c32504e09b2c5330aa6a18e1e1c9affd33 | [
"CC-BY-4.0"
] | 1 | 2021-08-04T09:48:38.000Z | 2021-08-04T09:48:38.000Z | tests/unit/test_nations.py | Lilykos/scoap3-next | b779b8c32504e09b2c5330aa6a18e1e1c9affd33 | [
"CC-BY-4.0"
] | 158 | 2018-09-10T07:31:14.000Z | 2022-03-30T07:18:51.000Z | tests/unit/test_nations.py | Lilykos/scoap3-next | b779b8c32504e09b2c5330aa6a18e1e1c9affd33 | [
"CC-BY-4.0"
] | 9 | 2015-04-28T11:55:04.000Z | 2021-09-28T12:14:53.000Z | from invenio_db import db
from scoap3.utils.nations import find_country
from scoap3.modules.analysis.models import CountryCache
| 26.410256 | 66 | 0.650485 | from invenio_db import db
from scoap3.utils.nations import find_country
from scoap3.modules.analysis.models import CountryCache
def test_countries():
test_affs = (
('CMS CERN Switzerland', 'CERN'),
('ETH Switzerland', 'Switzerland'),
('CMS CERN KEK', 'CERN'),
('KEK Japan', 'Japan'... | 853 | 0 | 46 |
6f49e02d2b15ebe518394fc9be8873a7f052a93a | 9,288 | py | Python | socialregistration/views.py | nsmgr8/aep-django-socialregistration | 2ffc25afe841892ba487fcb0e532336b2d21480e | [
"MIT"
] | 1 | 2015-11-06T01:09:35.000Z | 2015-11-06T01:09:35.000Z | socialregistration/views.py | nsmgr8/aep-django-socialregistration | 2ffc25afe841892ba487fcb0e532336b2d21480e | [
"MIT"
] | null | null | null | socialregistration/views.py | nsmgr8/aep-django-socialregistration | 2ffc25afe841892ba487fcb0e532336b2d21480e | [
"MIT"
] | null | null | null | """
Created on 22.09.2009
@author: alen
"""
import uuid
# from oauth import oauth # not used
from django.conf import settings
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response
from django.utils.translation import gettext as _
# from... | 33.774545 | 102 | 0.673342 | """
Created on 22.09.2009
@author: alen
"""
import uuid
# from oauth import oauth # not used
from django.conf import settings
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response
from django.utils.translation import gettext as _
# from... | 0 | 0 | 0 |
b0034c312c4cd987c207b73234671ccc4411bde1 | 6,690 | py | Python | test/kullback_leibler_divergence.py | nearj/mpvr-motionfiltering | 478304391e031a11bd15a604a272017ce8e48abf | [
"MIT"
] | null | null | null | test/kullback_leibler_divergence.py | nearj/mpvr-motionfiltering | 478304391e031a11bd15a604a272017ce8e48abf | [
"MIT"
] | null | null | null | test/kullback_leibler_divergence.py | nearj/mpvr-motionfiltering | 478304391e031a11bd15a604a272017ce8e48abf | [
"MIT"
] | 1 | 2019-07-14T01:32:04.000Z | 2019-07-14T01:32:04.000Z | import numpy as np
import pandas as pd
import matplotlib
matplotlib.use("TkAgg")
from matplotlib import pyplot as plt
import glob, os
LOAD_MOTION_DIR = './data/preprocessed/motion/'
LOAD_PROB_DIST = 'prob_dist/'
LOAD_CUMUL_DIST = 'cumul_dist/'
LOAD_COMPACT = 'compact/'
LOAD_VIDEO_DIR = './data/preprocessed/video/'
SA... | 31.408451 | 97 | 0.619581 | import numpy as np
import pandas as pd
import matplotlib
matplotlib.use("TkAgg")
from matplotlib import pyplot as plt
import glob, os
LOAD_MOTION_DIR = './data/preprocessed/motion/'
LOAD_PROB_DIST = 'prob_dist/'
LOAD_CUMUL_DIST = 'cumul_dist/'
LOAD_COMPACT = 'compact/'
LOAD_VIDEO_DIR = './data/preprocessed/video/'
SA... | 4,416 | 0 | 277 |
935b90689b1d12cc34dcdb0a63b4db35de3afc2a | 3,276 | py | Python | Bugscan_exploits-master/exp_list/exp-596.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 11 | 2020-05-30T13:53:49.000Z | 2021-03-17T03:20:59.000Z | Bugscan_exploits-master/exp_list/exp-596.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-13T03:25:18.000Z | 2020-07-21T06:24:16.000Z | Bugscan_exploits-master/exp_list/exp-596.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-30T13:53:51.000Z | 2020-12-01T21:44:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#__author__ = 'Medici.Yan'
#Rsync弱口令检测
import socket,struct,hashlib,base64,time
def initialisation(host,port):
'''
初始化并获得版本信息,每次会话前都要发送版本信息
'''
flag=False
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
rsync={"MagicHeader":"@RSYNCD:","HeaderVersion... | 29.513514 | 111 | 0.659341 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#__author__ = 'Medici.Yan'
#Rsync弱口令检测
import socket,struct,hashlib,base64,time
def assign(service, arg):
if service == "rsync" and len(arg)==2:
return True, arg
def audit(arg):
host=arg[0]
port=arg[1]
res=initialisation(host, port)
if res[0]:
#securit... | 1,838 | 0 | 71 |
0824678638e2c900614c5636b1ea19007ec02511 | 890 | py | Python | python exercises/dek_program065.py | dek-odoo/python-samples | 0109d19e0aec3f40ea39973948d99657f7c27135 | [
"Apache-2.0"
] | 3 | 2015-01-30T07:06:26.000Z | 2020-08-04T05:09:23.000Z | python exercises/dek_program065.py | dek-odoo/python-samples | 0109d19e0aec3f40ea39973948d99657f7c27135 | [
"Apache-2.0"
] | null | null | null | python exercises/dek_program065.py | dek-odoo/python-samples | 0109d19e0aec3f40ea39973948d99657f7c27135 | [
"Apache-2.0"
] | 7 | 2017-06-15T23:27:48.000Z | 2021-12-28T17:34:16.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#- Author : (DEK) Devendra Kavthekar
# program065:
# Write a program to compute:
# f(n)=f(n-1)+100 when n>0
# and f(0)=0
# with a given n input by console (n>0).
# Example:
# If the following n is given as input to the program:
# 5
# Then, the output of the p... | 20.697674 | 70 | 0.61573 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#- Author : (DEK) Devendra Kavthekar
# program065:
# Write a program to compute:
# f(n)=f(n-1)+100 when n>0
# and f(0)=0
# with a given n input by console (n>0).
# Example:
# If the following n is given as input to the program:
# 5
# Then, the output of the p... | 264 | 0 | 49 |
2d1e4311ee69635071cf22ac9474258ac1abe1f6 | 4,877 | py | Python | Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_properties.py | fhoering/autorest | b36c77ebb6a5c92aca72eea0894a683506af5817 | [
"MIT"
] | null | null | null | Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_properties.py | fhoering/autorest | b36c77ebb6a5c92aca72eea0894a683506af5817 | [
"MIT"
] | null | null | null | Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_properties.py | fhoering/autorest | b36c77ebb6a5c92aca72eea0894a683506af5817 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
from msrest.serialization import Model
class StorageAccountProperties(Model):
"""StorageAccountProperties.
:param provisioning_state: Gets ... | 55.420455 | 284 | 0.709042 | # coding=utf-8
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
from msrest.serialization import Model
class StorageAccountProperties(Model):
"""StorageAccountProperties.
:param provisioning_state: Gets ... | 814 | 0 | 27 |
e6a9ae50acd70f07f4d370e927c9c660c4fbc55b | 1,161 | py | Python | divide_conquer/week3/quicksort_last_pivot.py | liaoaoyuan97/standford_algorithms_specialization | 2914fdd397ce895d986ac855e78afd7a51ceff68 | [
"MIT"
] | null | null | null | divide_conquer/week3/quicksort_last_pivot.py | liaoaoyuan97/standford_algorithms_specialization | 2914fdd397ce895d986ac855e78afd7a51ceff68 | [
"MIT"
] | null | null | null | divide_conquer/week3/quicksort_last_pivot.py | liaoaoyuan97/standford_algorithms_specialization | 2914fdd397ce895d986ac855e78afd7a51ceff68 | [
"MIT"
] | 1 | 2021-01-18T19:35:48.000Z | 2021-01-18T19:35:48.000Z | from quicksort_first_pivot import read_input
if __name__ == "__main__":
input_arr = read_input('quicksort.txt')
cmp_cnt = quicksort_last_pivot(input_arr, 0, len(input_arr))
# print(input_arr)
print(cmp_cnt)
| 21.5 | 94 | 0.435831 | from quicksort_first_pivot import read_input
def quicksort_last_pivot(arr, l, r):
if (r - l) < 2:
return 0
t = arr[r - 1]
arr[r - 1] = arr[l]
arr[l] = t
p = arr[l]
i = l + 1
for j in range(l + 1, r):
if arr[j] < p:
t = arr[j]
arr[j] = arr[i]
... | 912 | 0 | 23 |
ce15c6c14c94e2dd9cfc31f90501724f9d7640a7 | 1,614 | py | Python | tests/test_spatial_methods.py | scotthavens/smrf | a492d01a5eef994e00728c1cbed9f693879bbade | [
"CC0-1.0"
] | null | null | null | tests/test_spatial_methods.py | scotthavens/smrf | a492d01a5eef994e00728c1cbed9f693879bbade | [
"CC0-1.0"
] | null | null | null | tests/test_spatial_methods.py | scotthavens/smrf | a492d01a5eef994e00728c1cbed9f693879bbade | [
"CC0-1.0"
] | null | null | null | # from copy import deepcopy
# from inicheck.tools import get_user_config, check_config, cast_all_variables
#
# from smrf.framework.model_framework import can_i_run_smrf
# from tests.test_configurations import SMRFTestCase
# class TestSpatialMethods(SMRFTestCase):
#
# def test_station_spatial_config(self):
# ... | 30.45283 | 78 | 0.623916 | # from copy import deepcopy
# from inicheck.tools import get_user_config, check_config, cast_all_variables
#
# from smrf.framework.model_framework import can_i_run_smrf
# from tests.test_configurations import SMRFTestCase
# class TestSpatialMethods(SMRFTestCase):
#
# def test_station_spatial_config(self):
# ... | 0 | 0 | 0 |
b971912aecb2966197acf17161c074e0b8736ab4 | 275 | py | Python | userena/__init__.py | juiceinc/django-userena | e4196c8b063576f432f2d7adf3c72a40a2764947 | [
"BSD-3-Clause"
] | 1 | 2021-09-22T04:11:35.000Z | 2021-09-22T04:11:35.000Z | userena/__init__.py | barszczmm/django-easy-userena | 096052d3e0c5ef0442d93fe90e1bd783f1c1dc7c | [
"BSD-3-Clause"
] | null | null | null | userena/__init__.py | barszczmm/django-easy-userena | 096052d3e0c5ef0442d93fe90e1bd783f1c1dc7c | [
"BSD-3-Clause"
] | null | null | null | """
Django accounts management made easy.
"""
VERSION = (1, 0, 2)
__version__ = '.'.join((str(each) for each in VERSION[:4]))
def get_version():
"""
Returns string with digit parts only as version.
"""
return '.'.join((str(each) for each in VERSION[:3]))
| 18.333333 | 59 | 0.614545 | """
Django accounts management made easy.
"""
VERSION = (1, 0, 2)
__version__ = '.'.join((str(each) for each in VERSION[:4]))
def get_version():
"""
Returns string with digit parts only as version.
"""
return '.'.join((str(each) for each in VERSION[:3]))
| 0 | 0 | 0 |
c109934941f0b2791d9a4efb027f4f0d54cac01a | 4,036 | py | Python | invoiceminer/invoicedao.py | liuganghao/nodesmtp | 3c85676aad16fdd19accd1e3a8386a3f41252bb9 | [
"MIT-0"
] | null | null | null | invoiceminer/invoicedao.py | liuganghao/nodesmtp | 3c85676aad16fdd19accd1e3a8386a3f41252bb9 | [
"MIT-0"
] | null | null | null | invoiceminer/invoicedao.py | liuganghao/nodesmtp | 3c85676aad16fdd19accd1e3a8386a3f41252bb9 | [
"MIT-0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import mysql.connector
import config
dbconfig = {
'host': '127.0.0.1',
'port': 3306,
'database': 'invoicerepo2',
'user': 'invoicerepo',
'password': 'invoicerepo',
'charset': 'utf8',
'use_unicode': True,
'get_warnings': True
}
cnx = mysql.... | 35.716814 | 105 | 0.6167 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import mysql.connector
import config
dbconfig = {
'host': '127.0.0.1',
'port': 3306,
'database': 'invoicerepo2',
'user': 'invoicerepo',
'password': 'invoicerepo',
'charset': 'utf8',
'use_unicode': True,
'get_warnings': True
}
cnx = mysql.... | 3,368 | 0 | 110 |
49759fea86430f0cfc51820f9715fe2bd4887b2d | 171 | py | Python | anthill/__init__.py | ayushpallav/anthill | 740b8fce4281dfc4ca587c21a2d37741c649d870 | [
"MIT"
] | 14 | 2020-05-22T20:57:29.000Z | 2021-08-19T14:56:32.000Z | anthill/__init__.py | ayushpallav/apple-pie | 740b8fce4281dfc4ca587c21a2d37741c649d870 | [
"MIT"
] | 2 | 2021-01-04T05:05:08.000Z | 2021-01-04T05:11:08.000Z | anthill/__init__.py | ayushpallav/apple-pie | 740b8fce4281dfc4ca587c21a2d37741c649d870 | [
"MIT"
] | null | null | null |
from __future__ import absolute_import
from __future__ import unicode_literals
__author__ = """Ayush Pallav"""
__email__ = 'ayushpallav@gmail.com'
__version__ = '1.0.3'
| 21.375 | 39 | 0.783626 |
from __future__ import absolute_import
from __future__ import unicode_literals
__author__ = """Ayush Pallav"""
__email__ = 'ayushpallav@gmail.com'
__version__ = '1.0.3'
| 0 | 0 | 0 |
74a654504882bc60989d2a32491b49f99b5b35f3 | 868 | py | Python | Algorithms/2_Implementation/40.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | 1 | 2021-11-25T13:39:30.000Z | 2021-11-25T13:39:30.000Z | Algorithms/2_Implementation/40.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | Algorithms/2_Implementation/40.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/non-divisible-subset/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'nonDivisibleSubset' function below.
#
# The function is expected to return an INTEGER.
# The function accepts following parameters:
# 1. INTEGER k
# 2. INTE... | 21.170732 | 70 | 0.650922 | # https://www.hackerrank.com/challenges/non-divisible-subset/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'nonDivisibleSubset' function below.
#
# The function is expected to return an INTEGER.
# The function accepts following parameters:
# 1. INTEGER k
# 2. INTE... | 164 | 0 | 23 |
dc984ef3e325b532ac1b9c0476cd98b87ffc16ed | 137 | py | Python | orderdictbyvalue/ord.py | cassiobotaro/Rivendell | dcdb2543e42dea26dc07c9134d65b48f2c99bcc7 | [
"Apache-2.0"
] | 31 | 2018-01-07T21:25:07.000Z | 2021-06-18T13:30:43.000Z | orderdictbyvalue/ord.py | cassiobotaro/Rivendell | dcdb2543e42dea26dc07c9134d65b48f2c99bcc7 | [
"Apache-2.0"
] | 3 | 2018-01-10T12:08:42.000Z | 2020-03-31T01:12:46.000Z | orderdictbyvalue/ord.py | cassiobotaro/Rivendell | dcdb2543e42dea26dc07c9134d65b48f2c99bcc7 | [
"Apache-2.0"
] | 4 | 2018-01-10T02:27:04.000Z | 2019-08-15T19:38:03.000Z | from operator import itemgetter
original = {1: 2, 2: 3, 3: 1}
ordered = dict(sorted(original.items(), key=itemgetter(1)))
print(ordered)
| 27.4 | 59 | 0.715328 | from operator import itemgetter
original = {1: 2, 2: 3, 3: 1}
ordered = dict(sorted(original.items(), key=itemgetter(1)))
print(ordered)
| 0 | 0 | 0 |
f7aa68274ca959e90a6d8620662bcf7c14598432 | 547 | py | Python | NEST/old_realisations/second_level/src/namespace.py | KseniiaKarpova/memristive-spinal-cord | 15be4aea80ede6315b9bf4ea76eec17b900f31e4 | [
"MIT"
] | null | null | null | NEST/old_realisations/second_level/src/namespace.py | KseniiaKarpova/memristive-spinal-cord | 15be4aea80ede6315b9bf4ea76eec17b900f31e4 | [
"MIT"
] | null | null | null | NEST/old_realisations/second_level/src/namespace.py | KseniiaKarpova/memristive-spinal-cord | 15be4aea80ede6315b9bf4ea76eec17b900f31e4 | [
"MIT"
] | null | null | null | from enum import Enum
| 12.72093 | 32 | 0.64351 | from enum import Enum
class Params(Enum):
MODEL = "model"
EES_RATE = "ees_rate"
INH_COEF = "inh_coef"
SPEED = "speed"
SIM_TIME = "sim_time"
C_TIME = "c_time"
RECORD_FROM = "record_from"
MULTITEST = "multitest"
ESS_THRESHOLD = "ees_threshold"
class Name(Enum):
MP_E = "MP_E"
class Afferent(Enum):
IA = 'Ia... | 0 | 358 | 161 |
b464ee281ecd92aaad1b1cf5e35eda916c2aedbd | 667 | py | Python | officials_expression.py | cbdb-project/SongMuZhiDataCleaning | ce4bace46ee62d7146acbb10f9470d09ad4aec7e | [
"MIT"
] | 1 | 2021-11-16T03:47:24.000Z | 2021-11-16T03:47:24.000Z | officials_expression.py | cbdb-project/SongMuZhiDataCleaning | ce4bace46ee62d7146acbb10f9470d09ad4aec7e | [
"MIT"
] | null | null | null | officials_expression.py | cbdb-project/SongMuZhiDataCleaning | ce4bace46ee62d7146acbb10f9470d09ad4aec7e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Create Time: 6/14/2021 4:16 PM
Author: Zhou
Generate the officials_list from officials.txt
"""
with open("officials.txt", encoding="utf-8") as file:
officials_raw = file.readlines()
officials_renew1 = []
print(officials_raw)
for item in officials_raw:
if "#" in ite... | 23 | 71 | 0.673163 | # -*- coding: utf-8 -*-
"""
Create Time: 6/14/2021 4:16 PM
Author: Zhou
Generate the officials_list from officials.txt
"""
with open("officials.txt", encoding="utf-8") as file:
officials_raw = file.readlines()
officials_renew1 = []
print(officials_raw)
for item in officials_raw:
if "#" in ite... | 0 | 0 | 0 |
85190cdc97a9ac629046e5ba66329c874656d0c0 | 307 | py | Python | core/Observer.py | arnaudcoj/m2s3_sci_tp3_avatar | 7662392495d4c458c2537e7f6151c2693ddb055f | [
"MIT"
] | 1 | 2016-12-06T08:44:00.000Z | 2016-12-06T08:44:00.000Z | core/Observer.py | arnaudcoj/m2s3_sci_tp3_avatar | 7662392495d4c458c2537e7f6151c2693ddb055f | [
"MIT"
] | null | null | null | core/Observer.py | arnaudcoj/m2s3_sci_tp3_avatar | 7662392495d4c458c2537e7f6151c2693ddb055f | [
"MIT"
] | null | null | null | class Observer(object):
"""docstring for Observer"""
| 30.7 | 65 | 0.644951 | class Observer(object):
"""docstring for Observer"""
def __init__(self):
super(Observer, self).__init__()
self.signalFunc = None
def onReceive(self, signal, emitter):
if self.signalFunc != None and signal in self.signalFunc:
self.signalFunc[signal](emitter)
| 197 | 0 | 53 |
be42d85a1b5860e44d6057829de7ec0f6f967523 | 14,959 | py | Python | omega/symbolic/orthotopes.py | tichakorn832/omega | 93aeda273dcd997b52921c48fd8813be6139b350 | [
"BSD-3-Clause"
] | null | null | null | omega/symbolic/orthotopes.py | tichakorn832/omega | 93aeda273dcd997b52921c48fd8813be6139b350 | [
"BSD-3-Clause"
] | null | null | null | omega/symbolic/orthotopes.py | tichakorn832/omega | 93aeda273dcd997b52921c48fd8813be6139b350 | [
"BSD-3-Clause"
] | null | null | null | """Boxes with integer size."""
# Copyright 2016-2018 by California Institute of Technology
# All rights reserved. Licensed under 3-clause BSD.
#
import logging
import natsort
from omega.logic import syntax as stx
from omega.symbolic.prime import support_issubset
from omega.symbolic.prime import joint_support
from ome... | 28.013109 | 64 | 0.539608 | """Boxes with integer size."""
# Copyright 2016-2018 by California Institute of Technology
# All rights reserved. Licensed under 3-clause BSD.
#
import logging
import natsort
from omega.logic import syntax as stx
from omega.symbolic.prime import support_issubset
from omega.symbolic.prime import joint_support
from ome... | 573 | 0 | 50 |
e0aeff9cc051f23b6ece16502afa9a2f2e1bf2be | 995 | py | Python | build/3rdparty_libraries.py | D15C0DE/openMSX | 5119a9657de4b82115c745f670cdc55dc7363133 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 320 | 2015-06-16T20:32:33.000Z | 2022-03-26T17:03:27.000Z | build/3rdparty_libraries.py | D15C0DE/openMSX | 5119a9657de4b82115c745f670cdc55dc7363133 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 2,592 | 2015-05-30T12:12:21.000Z | 2022-03-31T17:16:15.000Z | build/3rdparty_libraries.py | D15C0DE/openMSX | 5119a9657de4b82115c745f670cdc55dc7363133 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 74 | 2015-06-18T19:51:15.000Z | 2022-03-24T15:09:33.000Z | # Prints which 3rd party libraries are desired for the given configuration.
from components import requiredLibrariesFor
from configurations import getConfiguration
from libraries import allDependencies, librariesByName
from packages import iterDownloadablePackages
if __name__ == '__main__':
import sys
if len(sys.ar... | 27.638889 | 75 | 0.770854 | # Prints which 3rd party libraries are desired for the given configuration.
from components import requiredLibrariesFor
from configurations import getConfiguration
from libraries import allDependencies, librariesByName
from packages import iterDownloadablePackages
def main(platform, linkMode):
configuration = getCon... | 421 | 0 | 23 |
6f3c6c29bd14593517ad65aa1fd30da1171747eb | 2,880 | py | Python | src/bxgateway/services/ont/abstract_ont_block_cleanup_service.py | doubleukay/bxgateway | ac01fc9475c039cf4255576dd4ecd6bff6c48f69 | [
"MIT"
] | 21 | 2019-11-06T17:37:41.000Z | 2022-03-28T07:18:33.000Z | src/bxgateway/services/ont/abstract_ont_block_cleanup_service.py | doubleukay/bxgateway | ac01fc9475c039cf4255576dd4ecd6bff6c48f69 | [
"MIT"
] | 4 | 2019-11-06T22:08:00.000Z | 2021-12-08T06:20:51.000Z | src/bxgateway/services/ont/abstract_ont_block_cleanup_service.py | doubleukay/bxgateway | ac01fc9475c039cf4255576dd4ecd6bff6c48f69 | [
"MIT"
] | 10 | 2020-08-05T15:58:16.000Z | 2022-02-07T23:51:10.000Z | import typing
from abc import abstractmethod
from typing import TYPE_CHECKING
from bxcommon.connections.connection_type import ConnectionType
from bxcommon.services.transaction_service import TransactionService
from bxcommon.utils.object_hash import Sha256Hash
from bxgateway.messages.ont.block_ont_message import Bloc... | 39.452055 | 112 | 0.720486 | import typing
from abc import abstractmethod
from typing import TYPE_CHECKING
from bxcommon.connections.connection_type import ConnectionType
from bxcommon.services.transaction_service import TransactionService
from bxcommon.utils.object_hash import Sha256Hash
from bxgateway.messages.ont.block_ont_message import Bloc... | 1,533 | 0 | 80 |
ae4388c0a308227c714bb8c4e6e9e5811f61ebb5 | 3,317 | py | Python | mot3d/utils/utils.py | cvlab-epfl/mot3d | 165f598d06f17b4960f327a1f0b850d70a73d910 | [
"Apache-2.0"
] | null | null | null | mot3d/utils/utils.py | cvlab-epfl/mot3d | 165f598d06f17b4960f327a1f0b850d70a73d910 | [
"Apache-2.0"
] | null | null | null | mot3d/utils/utils.py | cvlab-epfl/mot3d | 165f598d06f17b4960f327a1f0b850d70a73d910 | [
"Apache-2.0"
] | 1 | 2021-12-08T11:48:27.000Z | 2021-12-08T11:48:27.000Z | #----------------------------------------------------------------------------
# Created By : Leonardo Citraro leonardo.citraro@epfl.ch
# Date: 2021
# ---------------------------------------------------------------------------
import os
import sys
import json
import yaml
import re
import os
import ast
import glob
impor... | 32.519608 | 80 | 0.599337 | #----------------------------------------------------------------------------
# Created By : Leonardo Citraro leonardo.citraro@epfl.ch
# Date: 2021
# ---------------------------------------------------------------------------
import os
import sys
import json
import yaml
import re
import os
import ast
import glob
impor... | 2,190 | 0 | 281 |
247b57e0510f0767393fe176e8b6f10d5ee3ce9f | 161 | py | Python | core/errors.py | DenysSmirnov/Insta | 0eaad7b6e9c2369c22ed504055d07cb77bc06906 | [
"MIT"
] | null | null | null | core/errors.py | DenysSmirnov/Insta | 0eaad7b6e9c2369c22ed504055d07cb77bc06906 | [
"MIT"
] | null | null | null | core/errors.py | DenysSmirnov/Insta | 0eaad7b6e9c2369c22ed504055d07cb77bc06906 | [
"MIT"
] | null | null | null | from flask import render_template, request
from . import main
@main.errorhandler(404) | 26.833333 | 47 | 0.801242 | from flask import render_template, request
from . import main
@main.errorhandler(404)
def page_not_found(error):
return render_template('errors/404.html'), 404 | 53 | 0 | 22 |
3d09ffa107832b2fbe3544f46431e0d95b431d51 | 859 | py | Python | aids/strings/is_anagram.py | ueg1990/aids | bb543c6f53983d59edbc6a522ca10d64efd9c42e | [
"MIT"
] | null | null | null | aids/strings/is_anagram.py | ueg1990/aids | bb543c6f53983d59edbc6a522ca10d64efd9c42e | [
"MIT"
] | null | null | null | aids/strings/is_anagram.py | ueg1990/aids | bb543c6f53983d59edbc6a522ca10d64efd9c42e | [
"MIT"
] | null | null | null | '''
In this module, we determine if two given strings are anagrams
'''
def is_anagram_sort(string_1, string_2):
'''
Return True if the two given strings are anagrams using sorting
'''
return sorted(string_1) == sorted(string_2)
def is_anagram_counter(string_1, string_2):
'''
Return True if the two given strin... | 20.95122 | 68 | 0.704307 | '''
In this module, we determine if two given strings are anagrams
'''
def is_anagram_sort(string_1, string_2):
'''
Return True if the two given strings are anagrams using sorting
'''
return sorted(string_1) == sorted(string_2)
def is_anagram_counter(string_1, string_2):
'''
Return True if the two given strin... | 0 | 0 | 0 |
314f9d1b87c9289904fd8f8429fc473b648a99ee | 959 | py | Python | api/social/validators/social_account_generic_validator.py | marinimau/wayne_django_rest | eeaef0b9e3544c0f678b7f66684ac56f5ef90759 | [
"MIT"
] | null | null | null | api/social/validators/social_account_generic_validator.py | marinimau/wayne_django_rest | eeaef0b9e3544c0f678b7f66684ac56f5ef90759 | [
"MIT"
] | 5 | 2021-04-08T20:43:19.000Z | 2021-09-22T19:42:03.000Z | api/social/validators/social_account_generic_validator.py | marinimau/wayne_django_rest | eeaef0b9e3544c0f678b7f66684ac56f5ef90759 | [
"MIT"
] | null | null | null | #
# wayne_django_rest copyright © 2020 - all rights reserved
# Created at: 28/10/2020
# By: mauromarini
# License: MIT
# Repository: https://github.com/marinimau/wayne_django_rest
# Credits: @marinimau (https://github.com/marinimau)
#
from rest_framework import serializers
from contents.messages.get_messag... | 34.25 | 120 | 0.548488 | #
# wayne_django_rest copyright © 2020 - all rights reserved
# Created at: 28/10/2020
# By: mauromarini
# License: MIT
# Repository: https://github.com/marinimau/wayne_django_rest
# Credits: @marinimau (https://github.com/marinimau)
#
from rest_framework import serializers
from contents.messages.get_messag... | 235 | 0 | 22 |
517b324b875fed384a40c3be31d0514dbb7663d2 | 1,613 | py | Python | Question_21_30/codes/question27.py | uehir0/Gasyori100knock | a38d3c516f5f965822610edcf113f59412905c03 | [
"MIT"
] | null | null | null | Question_21_30/codes/question27.py | uehir0/Gasyori100knock | a38d3c516f5f965822610edcf113f59412905c03 | [
"MIT"
] | null | null | null | Question_21_30/codes/question27.py | uehir0/Gasyori100knock | a38d3c516f5f965822610edcf113f59412905c03 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import matplotlib.pyplot as plt
img = cv2.imread("imori.jpg").astype(np.float)
H,W,C=img.shape
# Nearest Neighbor
a = 1.5
aH = int(a * H)
aW = int(a * W)
y = np.arange(aH).repeat(aW).reshape(aW,aH)
y = (y / a)
x = np.tile(np.arange(aW),(aH,1))
x = (x / a)
fy = np.floor(y).astype(np.int)... | 24.074627 | 74 | 0.537508 | import cv2
import numpy as np
import matplotlib.pyplot as plt
img = cv2.imread("imori.jpg").astype(np.float)
H,W,C=img.shape
# Nearest Neighbor
a = 1.5
aH = int(a * H)
aW = int(a * W)
y = np.arange(aH).repeat(aW).reshape(aW,aH)
y = (y / a)
x = np.tile(np.arange(aW),(aH,1))
x = (x / a)
fy = np.floor(y).astype(np.int)... | 281 | 0 | 23 |
d1e046d004824bfeb6e17bd750c82884ad9fb701 | 1,227 | py | Python | afriproperty/utils/context_processors.py | dark-codr/propertyconnect | 2ec6d427f55ecea37fd3db86dd8c8f2ccd6e5ee6 | [
"MIT"
] | null | null | null | afriproperty/utils/context_processors.py | dark-codr/propertyconnect | 2ec6d427f55ecea37fd3db86dd8c8f2ccd6e5ee6 | [
"MIT"
] | null | null | null | afriproperty/utils/context_processors.py | dark-codr/propertyconnect | 2ec6d427f55ecea37fd3db86dd8c8f2ccd6e5ee6 | [
"MIT"
] | null | null | null | from django.conf import settings
from afriproperty.property.models import City, Property, PropertyCompare
from afriproperty.tips.models import Tip
def settings_context(_request):
"""Settings available by default to the templates context."""
# Note: we intentionally do NOT expose the entire settings
# to ... | 51.125 | 125 | 0.719641 | from django.conf import settings
from afriproperty.property.models import City, Property, PropertyCompare
from afriproperty.tips.models import Tip
def settings_context(_request):
"""Settings available by default to the templates context."""
# Note: we intentionally do NOT expose the entire settings
# to ... | 0 | 0 | 0 |
64c3a1b256280acd0c945fc416d86a7cbde97fd2 | 2,233 | py | Python | qiskit/chemistry/transformations/__init__.py | stefan-woerner/aqua | 12e1b867e254977d9c5992612a7919d8fe016cb4 | [
"Apache-2.0"
] | 504 | 2018-12-15T16:34:03.000Z | 2022-03-26T11:24:53.000Z | qiskit/chemistry/transformations/__init__.py | stefan-woerner/aqua | 12e1b867e254977d9c5992612a7919d8fe016cb4 | [
"Apache-2.0"
] | 746 | 2018-12-16T16:44:42.000Z | 2021-07-10T16:59:43.000Z | qiskit/chemistry/transformations/__init__.py | stefan-woerner/aqua | 12e1b867e254977d9c5992612a7919d8fe016cb4 | [
"Apache-2.0"
] | 421 | 2018-12-22T14:49:00.000Z | 2022-03-04T09:47:07.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 30.175676 | 96 | 0.685177 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 0 | 0 | 0 |
5b945e679592f7fceb8f2be8c53d5f108fc7aee1 | 726 | py | Python | scripts/common.py | marcusbfs/msanalyzer | 5a633716807a8ffe44c7651cf70de8fea10a1532 | [
"MIT"
] | null | null | null | scripts/common.py | marcusbfs/msanalyzer | 5a633716807a8ffe44c7651cf70de8fea10a1532 | [
"MIT"
] | 1 | 2020-06-29T19:43:58.000Z | 2020-06-29T19:43:58.000Z | scripts/common.py | marcusbfs/msanalyzer | 5a633716807a8ffe44c7651cf70de8fea10a1532 | [
"MIT"
] | null | null | null | import os
from pathlib import Path
scripts_dir = Path(__file__).parent.absolute()
repo_dir = scripts_dir.parent.absolute()
python_exe = os.path.join(repo_dir, "msanalyzer_venv", "Scripts", "python.exe")
dist_folder = scripts_dir / "dist"
main_py = os.path.join(repo_dir, "local_api.py")
# mpl data
matplotlibrc = script... | 34.571429 | 81 | 0.735537 | import os
from pathlib import Path
scripts_dir = Path(__file__).parent.absolute()
repo_dir = scripts_dir.parent.absolute()
python_exe = os.path.join(repo_dir, "msanalyzer_venv", "Scripts", "python.exe")
dist_folder = scripts_dir / "dist"
main_py = os.path.join(repo_dir, "local_api.py")
# mpl data
matplotlibrc = script... | 0 | 0 | 0 |
bfbf999baf70de3061e67f6078a9d972a67fe7b6 | 2,402 | py | Python | samples/parallel-processing-california-housing-data/ml_model/training/training_aml.py | h2floh/MLOpsManufacturing-1 | 3fcf15ef80600540450d16eae57b853d88a83063 | [
"Apache-2.0"
] | 20 | 2020-11-09T08:20:13.000Z | 2021-12-03T06:15:45.000Z | samples/parallel-processing-california-housing-data/ml_model/training/training_aml.py | h2floh/MLOpsManufacturing-1 | 3fcf15ef80600540450d16eae57b853d88a83063 | [
"Apache-2.0"
] | 55 | 2020-10-20T02:18:56.000Z | 2021-07-26T04:52:23.000Z | samples/parallel-processing-california-housing-data/ml_model/training/training_aml.py | h2floh/MLOpsManufacturing-1 | 3fcf15ef80600540450d16eae57b853d88a83063 | [
"Apache-2.0"
] | 10 | 2020-11-26T05:47:57.000Z | 2022-03-23T20:26:00.000Z | """Training wrapper: script to be executed when running Training Step."""
import json
from logging import INFO, Formatter, StreamHandler, getLogger
from pathlib import Path, PurePath
import click
import joblib
import pandas as pd
from azureml.core import Run
from sklearn.linear_model import LinearRegression
from skle... | 31.194805 | 142 | 0.697752 | """Training wrapper: script to be executed when running Training Step."""
import json
from logging import INFO, Formatter, StreamHandler, getLogger
from pathlib import Path, PurePath
import click
import joblib
import pandas as pd
from azureml.core import Run
from sklearn.linear_model import LinearRegression
from skle... | 0 | 0 | 0 |
68cccd3cc90109ca345a52907a058260c53869b4 | 632 | py | Python | python_demos/sockets_demo/server.py | t4d-classes/advanced-python_01102022 | bf20d78f0ad44324998ceed8bdd377ec1805f97e | [
"MIT"
] | null | null | null | python_demos/sockets_demo/server.py | t4d-classes/advanced-python_01102022 | bf20d78f0ad44324998ceed8bdd377ec1805f97e | [
"MIT"
] | null | null | null | python_demos/sockets_demo/server.py | t4d-classes/advanced-python_01102022 | bf20d78f0ad44324998ceed8bdd377ec1805f97e | [
"MIT"
] | 1 | 2022-01-14T18:12:37.000Z | 2022-01-14T18:12:37.000Z | """ sockets server """
import socket
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as socket_server:
socket_server.bind( ('127.0.0.1', 5025) )
socket_server.listen()
print("server is listening on 127.0.0.1:5025")
conn, addr = socket_server.accept() # accept is the blocking call
pr... | 28.727273 | 72 | 0.636076 | """ sockets server """
import socket
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as socket_server:
socket_server.bind( ('127.0.0.1', 5025) )
socket_server.listen()
print("server is listening on 127.0.0.1:5025")
conn, addr = socket_server.accept() # accept is the blocking call
pr... | 0 | 0 | 0 |
7751ad7868874cbb688e851001166aa82832d728 | 56,164 | py | Python | samples/NGPF/SDN/BGP-Flowspec/BGP6_FS_Sample_Scripts.py | vlad-shulika/ixnetwork-api-py | 2ed71d52dd210a2d08250256c3b198a9c7c67dca | [
"MIT"
] | 3 | 2018-12-04T20:06:13.000Z | 2022-02-04T01:28:45.000Z | samples/NGPF/SDN/BGP-Flowspec/BGP6_FS_Sample_Scripts.py | vlad-shulika/ixnetwork-api-py | 2ed71d52dd210a2d08250256c3b198a9c7c67dca | [
"MIT"
] | 3 | 2018-05-23T17:32:56.000Z | 2020-08-26T13:00:42.000Z | samples/NGPF/SDN/BGP-Flowspec/BGP6_FS_Sample_Scripts.py | vlad-shulika/ixnetwork-api-py | 2ed71d52dd210a2d08250256c3b198a9c7c67dca | [
"MIT"
] | 9 | 2018-12-04T20:09:24.000Z | 2021-05-12T10:28:05.000Z | # -*- coding: utf-8 -*-
################################################################################
# #
# Copyright 1997 - 2019 by IXIA Keysight #
# All Rights Reserved. ... | 58.080662 | 120 | 0.406933 | # -*- coding: utf-8 -*-
################################################################################
# #
# Copyright 1997 - 2019 by IXIA Keysight #
# All Rights Reserved. ... | 261 | 0 | 35 |
97d3194970801ca487043f8c63ccb960d205ee40 | 260 | py | Python | Django/e-commerce-website/store/context_processors.py | piaochung/blog | 3fc518c6b681e070e46dffaf64fae1086423a5e6 | [
"MIT"
] | null | null | null | Django/e-commerce-website/store/context_processors.py | piaochung/blog | 3fc518c6b681e070e46dffaf64fae1086423a5e6 | [
"MIT"
] | null | null | null | Django/e-commerce-website/store/context_processors.py | piaochung/blog | 3fc518c6b681e070e46dffaf64fae1086423a5e6 | [
"MIT"
] | null | null | null | from .models import ReviewRating, Brand
| 21.666667 | 69 | 0.723077 | from .models import ReviewRating, Brand
def all_review(request):
reviews = ReviewRating.objects.all().order_by('-created_at')[:10]
return dict(reviews=reviews)
def all_brand(request):
brands = Brand.objects.all()
return dict(brands=brands)
| 172 | 0 | 46 |
896720188f12860fb4c146d44d47d36fcb941d6d | 6,972 | py | Python | neuro-sdk/tests/test_buckets.py | neuro-inc/platform-client-python | 012e355249ea900b76f9ce4209fb9d029652f9b2 | [
"Apache-2.0"
] | 11 | 2020-10-11T15:38:11.000Z | 2021-11-09T11:29:50.000Z | neuro-sdk/tests/test_buckets.py | neuro-inc/platform-client-python | 012e355249ea900b76f9ce4209fb9d029652f9b2 | [
"Apache-2.0"
] | 611 | 2020-09-30T21:27:52.000Z | 2022-01-10T10:44:44.000Z | neuro-sdk/tests/test_buckets.py | neuro-inc/platform-client-python | 012e355249ea900b76f9ce4209fb9d029652f9b2 | [
"Apache-2.0"
] | 1 | 2020-10-05T15:10:24.000Z | 2020-10-05T15:10:24.000Z | from datetime import datetime, timedelta
from typing import Callable
from aiohttp import web
from neuro_sdk import Bucket, Client, Cluster
from tests import _TestServerFactory
_MakeClient = Callable[..., Client]
| 28.341463 | 88 | 0.535427 | from datetime import datetime, timedelta
from typing import Callable
from aiohttp import web
from neuro_sdk import Bucket, Client, Cluster
from tests import _TestServerFactory
_MakeClient = Callable[..., Client]
async def test_list(
aiohttp_server: _TestServerFactory,
make_client: _MakeClient,
cluster... | 6,612 | 0 | 138 |
60d70cec2b665030a43396f02afba76673f24945 | 451 | py | Python | stanza/utils/select_backoff.py | danielhers/stanza | d747a7b781da203c286ec51e3842fecb8b0abb15 | [
"Apache-2.0"
] | 3,633 | 2016-01-21T17:29:13.000Z | 2022-03-31T13:36:47.000Z | stanza/utils/select_backoff.py | danielhers/stanza | d747a7b781da203c286ec51e3842fecb8b0abb15 | [
"Apache-2.0"
] | 593 | 2016-01-19T07:16:05.000Z | 2022-03-31T20:23:58.000Z | stanza/utils/select_backoff.py | danielhers/stanza | d747a7b781da203c286ec51e3842fecb8b0abb15 | [
"Apache-2.0"
] | 525 | 2016-01-20T03:22:19.000Z | 2022-03-24T05:51:56.000Z | import sys
backoff_models = { "UD_Breton-KEB": "ga_idt",
"UD_Czech-PUD": "cs_pdt",
"UD_English-PUD": "en_ewt",
"UD_Faroese-OFT": "nn_nynorsk",
"UD_Finnish-PUD": "fi_tdt",
"UD_Japanese-Modern": "ja_gsd",
"U... | 32.214286 | 51 | 0.467849 | import sys
backoff_models = { "UD_Breton-KEB": "ga_idt",
"UD_Czech-PUD": "cs_pdt",
"UD_English-PUD": "en_ewt",
"UD_Faroese-OFT": "nn_nynorsk",
"UD_Finnish-PUD": "fi_tdt",
"UD_Japanese-Modern": "ja_gsd",
"U... | 0 | 0 | 0 |
c4e65e1df7c301101446ffc48d8206c89fed3575 | 2,605 | py | Python | scripts/02_bert_ner/main.py | harri-pltr/slovnet | 5cd91358ca32f6c08cf38b8f39b3058643bc26dc | [
"MIT"
] | 147 | 2019-09-02T10:56:38.000Z | 2022-03-31T16:09:01.000Z | scripts/02_bert_ner/main.py | harri-pltr/slovnet | 5cd91358ca32f6c08cf38b8f39b3058643bc26dc | [
"MIT"
] | 9 | 2020-04-28T13:58:12.000Z | 2022-02-19T21:45:55.000Z | scripts/02_bert_ner/main.py | harri-pltr/slovnet | 5cd91358ca32f6c08cf38b8f39b3058643bc26dc | [
"MIT"
] | 14 | 2020-03-01T21:09:34.000Z | 2022-03-12T19:34:36.000Z |
from os import getenv, environ
from os.path import exists, join, expanduser
from random import seed, sample, randint, uniform
from subprocess import run
from tqdm.notebook import tqdm as log_progress
import torch
from torch import optim
from naeval.ner.datasets import (
load_factru,
load_ne5,
)
from slovne... | 21.178862 | 54 | 0.722457 |
from os import getenv, environ
from os.path import exists, join, expanduser
from random import seed, sample, randint, uniform
from subprocess import run
from tqdm.notebook import tqdm as log_progress
import torch
from torch import optim
from naeval.ner.datasets import (
load_factru,
load_ne5,
)
from slovne... | 290 | 0 | 23 |
23740683f3458ce2d3f4a021484dd413b45aecac | 3,320 | py | Python | topologic/assertions.py | microsoft/topologic | d3a2155a42469ccb16de178f47bec81b0476fdc8 | [
"MIT"
] | 24 | 2020-02-10T23:51:06.000Z | 2021-11-17T02:34:47.000Z | topologic/assertions.py | microsoft/topologic | d3a2155a42469ccb16de178f47bec81b0476fdc8 | [
"MIT"
] | 26 | 2020-02-11T18:37:33.000Z | 2020-11-11T00:14:41.000Z | topologic/assertions.py | microsoft/topologic | d3a2155a42469ccb16de178f47bec81b0476fdc8 | [
"MIT"
] | 6 | 2020-07-31T11:05:36.000Z | 2021-11-10T08:18:52.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import networkx as nx
from .exceptions import UnweightedGraphError, InvalidGraphError
def assert_is_graph(graph: nx.Graph):
"""
Asserts that an object is a networkx graph
:param graph: Graph to check
:raises TypeError: If graph... | 32.54902 | 119 | 0.688554 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import networkx as nx
from .exceptions import UnweightedGraphError, InvalidGraphError
def assert_is_graph(graph: nx.Graph):
"""
Asserts that an object is a networkx graph
:param graph: Graph to check
:raises TypeError: If graph... | 0 | 0 | 0 |
57c964552b45482b7441ec5b960b53d8286f9d90 | 294 | py | Python | beacon_controller/providers/sparql.py | NCATS-Tangerine/rhea-beacon | ccf6e790dc4c26eb4853b1bcb78382b84fbfe238 | [
"MIT"
] | null | null | null | beacon_controller/providers/sparql.py | NCATS-Tangerine/rhea-beacon | ccf6e790dc4c26eb4853b1bcb78382b84fbfe238 | [
"MIT"
] | 10 | 2018-08-18T03:13:08.000Z | 2019-02-05T20:04:15.000Z | beacon_controller/providers/sparql.py | NCATS-Tangerine/rhea-beacon | ccf6e790dc4c26eb4853b1bcb78382b84fbfe238 | [
"MIT"
] | null | null | null | from typing import List
| 22.615385 | 65 | 0.520408 | from typing import List
class SparqlBuilder(object):
def __init__(self, select:List[str], size=None, offset=None):
self.query = f"""
PREFIX rh:<http://rdf.rhea-db.org/>
SELECT
{' '.join([f'?{s}' for s in select])}
WHERE {{
}}
"""
| 214 | 7 | 49 |
9621d12e8a4473ce15a62326ae65c3a784143860 | 8,937 | py | Python | python/ooi_data_explorations/uncabled/process_metbk.py | bkuebel/ooi-data-explorations | 906221d9d9a01ee96b1747d3abab2b0b46ae534d | [
"MIT"
] | null | null | null | python/ooi_data_explorations/uncabled/process_metbk.py | bkuebel/ooi-data-explorations | 906221d9d9a01ee96b1747d3abab2b0b46ae534d | [
"MIT"
] | null | null | null | python/ooi_data_explorations/uncabled/process_metbk.py | bkuebel/ooi-data-explorations | 906221d9d9a01ee96b1747d3abab2b0b46ae534d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import os
from ooi_data_explorations.common import inputs, m2m_collect, m2m_request, get_deployment_dates, \
get_vocabulary, dt64_epoch, update_dataset, ENCODINGS
from gsw.conversions import SP_from_C
def metbk_hourly(ds):
"""
Takes METBK h... | 43.595122 | 119 | 0.657827 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import os
from ooi_data_explorations.common import inputs, m2m_collect, m2m_request, get_deployment_dates, \
get_vocabulary, dt64_epoch, update_dataset, ENCODINGS
from gsw.conversions import SP_from_C
def metbk_hourly(ds):
"""
Takes METBK h... | 2,614 | 0 | 23 |
5ed3760c73aad0d60a0d193d442935018566c4c5 | 986 | py | Python | Curso de Cisco/Actividades/Act 4 - Modulo 5.py | tomasfriz/Curso-de-Cisco | a50ee5fa96bd86d468403e29ccdc3565a181af60 | [
"MIT"
] | null | null | null | Curso de Cisco/Actividades/Act 4 - Modulo 5.py | tomasfriz/Curso-de-Cisco | a50ee5fa96bd86d468403e29ccdc3565a181af60 | [
"MIT"
] | null | null | null | Curso de Cisco/Actividades/Act 4 - Modulo 5.py | tomasfriz/Curso-de-Cisco | a50ee5fa96bd86d468403e29ccdc3565a181af60 | [
"MIT"
] | null | null | null | # Ingresa el texto a encriptar
texto= input("Ingresa un mensaje: ")
# Ingresa un valor de cambio válido (repitelo hasta que tengas éxito)
shift = 0
while shift == 0:
try:
shift = int(input("Ingresa el valor de cambio del cifrado (1..25): "))
if shift not in range(1,26):
raise ValueEr... | 25.947368 | 78 | 0.573022 | # Ingresa el texto a encriptar
texto= input("Ingresa un mensaje: ")
# Ingresa un valor de cambio válido (repitelo hasta que tengas éxito)
shift = 0
while shift == 0:
try:
shift = int(input("Ingresa el valor de cambio del cifrado (1..25): "))
if shift not in range(1,26):
raise ValueEr... | 0 | 0 | 0 |
988e680492f22ebcc0f0fa652f67a59c3838817c | 132 | py | Python | datapackage_pipelines/generators/__init__.py | gperonato/datapackage-pipelines | 72b98918db1c19590586a3a85c5b087227cbbc3b | [
"MIT"
] | 109 | 2016-09-01T08:41:55.000Z | 2021-11-10T10:08:35.000Z | datapackage_pipelines/generators/__init__.py | gperonato/datapackage-pipelines | 72b98918db1c19590586a3a85c5b087227cbbc3b | [
"MIT"
] | 144 | 2016-08-30T16:26:50.000Z | 2021-04-18T09:06:12.000Z | datapackage_pipelines/generators/__init__.py | gperonato/datapackage-pipelines | 72b98918db1c19590586a3a85c5b087227cbbc3b | [
"MIT"
] | 34 | 2016-09-05T12:46:53.000Z | 2022-03-05T01:53:49.000Z | from slugify import slugify
from .schedules import * # noqa
from .generator_base import GeneratorBase
from .utilities import steps
| 22 | 41 | 0.818182 | from slugify import slugify
from .schedules import * # noqa
from .generator_base import GeneratorBase
from .utilities import steps
| 0 | 0 | 0 |
bddd1dfc42fb14a1b260e398046b860098146bdc | 465 | py | Python | sdk/boost_1_30_0/libs/python/test/exception_translator.py | acidicMercury8/xray-1.0 | 65e85c0e31e82d612c793d980dc4b73fa186c76c | [
"Linux-OpenIB"
] | 2 | 2020-01-30T12:51:49.000Z | 2020-08-31T08:36:49.000Z | sdk/boost_1_30_0/libs/python/test/exception_translator.py | acidicMercury8/xray-1.0 | 65e85c0e31e82d612c793d980dc4b73fa186c76c | [
"Linux-OpenIB"
] | null | null | null | sdk/boost_1_30_0/libs/python/test/exception_translator.py | acidicMercury8/xray-1.0 | 65e85c0e31e82d612c793d980dc4b73fa186c76c | [
"Linux-OpenIB"
] | null | null | null | '''
>>> from exception_translator_ext import *
>>> try:
... throw_error();
... except RuntimeError, x:
... print x
... else:
... print 'Expected a RuntimeError!'
!!!error!!!
'''
if __name__ == '__main__':
print "running..."
import sys
sys.exit(run()[0])
| 20.217391 | 54 | 0.56129 | '''
>>> from exception_translator_ext import *
>>> try:
... throw_error();
... except RuntimeError, x:
... print x
... else:
... print 'Expected a RuntimeError!'
!!!error!!!
'''
def run(args = None):
import sys
import doctest
if args is not None:
sys.argv = args
retu... | 144 | 0 | 23 |
1b0ba3d50363aa9f463569b4c8e20c084a432f0a | 3,069 | py | Python | trivium/api/rest_organization.py | TripleDotEng/trivium-cli | 4291ed1d71d728ac3c0c738f7367f21521e393f4 | [
"MIT"
] | null | null | null | trivium/api/rest_organization.py | TripleDotEng/trivium-cli | 4291ed1d71d728ac3c0c738f7367f21521e393f4 | [
"MIT"
] | null | null | null | trivium/api/rest_organization.py | TripleDotEng/trivium-cli | 4291ed1d71d728ac3c0c738f7367f21521e393f4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
api/rest_organization.py
Copyright 2021 Triple Dot Engineering LLC
Defines the RestOrg class used to interact with organizations via the API.
"""
import json
from .. import util
from ._abc_rest_obj import RestObject
from .api import TriviumApi
class RestOrg(RestObject):
"""Class for in... | 24.95122 | 79 | 0.548061 | #!/usr/bin/env python
"""
api/rest_organization.py
Copyright 2021 Triple Dot Engineering LLC
Defines the RestOrg class used to interact with organizations via the API.
"""
import json
from .. import util
from ._abc_rest_obj import RestObject
from .api import TriviumApi
class RestOrg(RestObject):
"""Class for in... | 130 | 0 | 78 |
f2e4a7dd070ea5b620ce537ba77f87661d30b168 | 509 | py | Python | test/test_main.py | ajalba/gopredict | bfcb1c4c10b6787da10c7515ae2adf65252bb8c6 | [
"MIT"
] | null | null | null | test/test_main.py | ajalba/gopredict | bfcb1c4c10b6787da10c7515ae2adf65252bb8c6 | [
"MIT"
] | 39 | 2021-10-31T16:51:39.000Z | 2021-11-22T09:56:04.000Z | test/test_main.py | ajalba/gopredict | bfcb1c4c10b6787da10c7515ae2adf65252bb8c6 | [
"MIT"
] | null | null | null | from pytest_mock import MockerFixture
from gopredict.__main__ import main_loop
| 25.45 | 80 | 0.781925 | from pytest_mock import MockerFixture
from gopredict.__main__ import main_loop
def test_main_llama_subida_archivo(mocker: MockerFixture):
mocked_func=mocker.patch('gopredict.carga_descarga_ficheros.subida_archivo')
mock_loop = mocker.patch('gopredict.__main__.main_loop')
main_loop()
mocked_func.assert... | 367 | 0 | 46 |
49e82d7eedc2e715c06f458b32cf77e502903b12 | 4,857 | py | Python | everglade/lexer.py | DefaltSimon/everglade | 401060e59c5fe95338bf2843d932462515fcb89c | [
"MIT"
] | null | null | null | everglade/lexer.py | DefaltSimon/everglade | 401060e59c5fe95338bf2843d932462515fcb89c | [
"MIT"
] | null | null | null | everglade/lexer.py | DefaltSimon/everglade | 401060e59c5fe95338bf2843d932462515fcb89c | [
"MIT"
] | null | null | null | # coding=utf-8
from everglade.tokens import TokenType, Token
ALLOWED_CHARS = "abcdefghijklmnopqrstuvwxyz_"
| 28.739645 | 70 | 0.463043 | # coding=utf-8
from everglade.tokens import TokenType, Token
ALLOWED_CHARS = "abcdefghijklmnopqrstuvwxyz_"
def is_special(char: str) -> bool:
return char in ALLOWED_CHARS
class Lexer:
def __init__(self, raw_text):
self.text = raw_text
self.pos = 0
self.char = self.text[self.pos]
... | 4,151 | 550 | 46 |
d81e1db454bd112ebe4b9eb0e928f7c781014326 | 32,155 | py | Python | datasets/thelook_ecommerce/pipelines/_images/run_thelook_kub/fake.py | arjunsgill/public-datasets-pipelines | 45dd0b2c15821e38f0b7b511c253025fc7497ad0 | [
"Apache-2.0"
] | null | null | null | datasets/thelook_ecommerce/pipelines/_images/run_thelook_kub/fake.py | arjunsgill/public-datasets-pipelines | 45dd0b2c15821e38f0b7b511c253025fc7497ad0 | [
"Apache-2.0"
] | null | null | null | datasets/thelook_ecommerce/pipelines/_images/run_thelook_kub/fake.py | arjunsgill/public-datasets-pipelines | 45dd0b2c15821e38f0b7b511c253025fc7497ad0 | [
"Apache-2.0"
] | null | null | null | import collections
import csv
import dataclasses
import datetime
import io
import itertools
import json
import logging
import os
import random
import typing
import uuid
import faker
import numpy as np
from google.cloud import storage
fake = faker.Faker()
# final datasets
orders = list()
users = list()
order_items = l... | 39.070474 | 261 | 0.621832 | import collections
import csv
import dataclasses
import datetime
import io
import itertools
import json
import logging
import os
import random
import typing
import uuid
import faker
import numpy as np
from google.cloud import storage
fake = faker.Faker()
# final datasets
orders = list()
users = list()
order_items = l... | 24,341 | 5,717 | 481 |
18babf467d84bab7ec1d299308b0f96c72b2c39c | 16,833 | py | Python | export_pmx.py | ousttrue/blpymeshio | 6f79c0b1c902f297ebb562cee633fbbab8790cd6 | [
"MIT"
] | 4 | 2019-10-02T20:46:18.000Z | 2021-03-16T23:35:48.000Z | export_pmx.py | ousttrue/blpymeshio | 6f79c0b1c902f297ebb562cee633fbbab8790cd6 | [
"MIT"
] | 3 | 2018-08-27T16:15:33.000Z | 2020-05-19T17:29:50.000Z | export_pmx.py | ousttrue/blpymeshio | 6f79c0b1c902f297ebb562cee633fbbab8790cd6 | [
"MIT"
] | 5 | 2019-05-13T18:23:39.000Z | 2021-07-05T20:56:10.000Z | # coding: utf-8
import io
from . import bl
from . import exporter
from pymeshio import pmx
from pymeshio import common
from pymeshio.pmx import writer
import bpy
import bpy_extras.io_utils # pylint: disable=E0401
def create_pmx(ex, enable_bdef4=True):
"""
PMX 出力
"""
model=pmx.Model()
o=ex.root.... | 35.141962 | 92 | 0.558308 | # coding: utf-8
import io
from . import bl
from . import exporter
from pymeshio import pmx
from pymeshio import common
from pymeshio.pmx import writer
import bpy
import bpy_extras.io_utils # pylint: disable=E0401
def near(x, y, EPSILON=1e-5):
d=x-y
return d>=-EPSILON and d<=EPSILON
def create_pmx(ex, enabl... | 6,087 | -1 | 438 |
43dd17c2074898d20de66fd0bfb62f3790e78406 | 4,400 | py | Python | explorerscript/ssb_converting/compiler/compile_handlers/blocks/ifs/if_header.py | dotlambda/ExplorerScript | 5fbb5de3d58821eb79f1972e8df9af26fefadaa4 | [
"MIT"
] | 11 | 2020-06-05T06:29:06.000Z | 2022-03-11T09:50:09.000Z | explorerscript/ssb_converting/compiler/compile_handlers/blocks/ifs/if_header.py | dotlambda/ExplorerScript | 5fbb5de3d58821eb79f1972e8df9af26fefadaa4 | [
"MIT"
] | 16 | 2020-06-19T11:59:08.000Z | 2022-01-10T09:08:53.000Z | explorerscript/ssb_converting/compiler/compile_handlers/blocks/ifs/if_header.py | dotlambda/ExplorerScript | 5fbb5de3d58821eb79f1972e8df9af26fefadaa4 | [
"MIT"
] | 2 | 2021-11-14T16:33:30.000Z | 2021-12-18T22:05:31.000Z | # MIT License
#
# Copyright (c) 2020-2021 Parakoopa and the SkyTemple Contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the... | 50.574713 | 115 | 0.724318 | # MIT License
#
# Copyright (c) 2020-2021 Parakoopa and the SkyTemple Contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the... | 1,992 | 32 | 130 |
cd628422609e27fdd51e2466d4b2bf2b47fb7c29 | 1,216 | py | Python | old/UG/tests/blackbox/syndicate-httpd/PUT.py | jcnelson/syndicate | 4837265be3e0aa18cdf4ee50316dbfc2d1f06e5b | [
"Apache-2.0"
] | 16 | 2015-01-02T15:39:04.000Z | 2016-03-17T06:38:46.000Z | old/UG/tests/blackbox/syndicate-httpd/PUT.py | jcnelson/syndicate | 4837265be3e0aa18cdf4ee50316dbfc2d1f06e5b | [
"Apache-2.0"
] | 37 | 2015-01-28T20:58:05.000Z | 2016-03-22T04:01:32.000Z | old/UG/tests/blackbox/syndicate-httpd/PUT.py | jcnelson/syndicate | 4837265be3e0aa18cdf4ee50316dbfc2d1f06e5b | [
"Apache-2.0"
] | 8 | 2015-04-08T02:26:03.000Z | 2016-03-04T05:56:24.000Z | #!/usr/bin/python
import socket
import time
import sys
import urllib2
import os
import base64
auth = "jude:sniff"
hostname = sys.argv[1]
port = int(sys.argv[2] )
filename = sys.argv[3]
data_fd = None
data_path = None
if len(sys.argv) > 4:
data_path = sys.argv[4]
data_fd = open( data_path, "r" )
mode = '0644'
... | 19.612903 | 69 | 0.602796 | #!/usr/bin/python
import socket
import time
import sys
import urllib2
import os
import base64
auth = "jude:sniff"
hostname = sys.argv[1]
port = int(sys.argv[2] )
filename = sys.argv[3]
data_fd = None
data_path = None
if len(sys.argv) > 4:
data_path = sys.argv[4]
data_fd = open( data_path, "r" )
mode = '0644'
... | 0 | 0 | 0 |
222dad8d3e3e093ca70837072f98d16ce20b3b5b | 2,212 | py | Python | pre_commit_sync/pre_commit_sync.py | dvolgyes/pre-commit-sync | b61c881baa204a72987a20b20e4fa03e660c1035 | [
"BSD-3-Clause"
] | 1 | 2020-09-29T22:03:11.000Z | 2020-09-29T22:03:11.000Z | pre_commit_sync/pre_commit_sync.py | dvolgyes/pre-commit-sync | b61c881baa204a72987a20b20e4fa03e660c1035 | [
"BSD-3-Clause"
] | null | null | null | pre_commit_sync/pre_commit_sync.py | dvolgyes/pre-commit-sync | b61c881baa204a72987a20b20e4fa03e660c1035 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
import sys
import argparse
from pathlib import Path
import urllib.request
import git
if __name__ == '__main__':
main()
| 29.105263 | 105 | 0.613472 | #!/usr/bin/python
import sys
import argparse
from pathlib import Path
import urllib.request
import git
def process(fname, url):
f = Path(fname.strip())
with urllib.request.urlopen(url) as web:
content = web.read()
if f.exists():
file_content = f.read_bytes()
else:
file_conten... | 2,022 | 0 | 46 |
59976c7e201cb504051a3226d3f0899be2813ff7 | 433 | py | Python | test/testAll.py | slalom/sf-iot-hackathon | 89a1f147e1be7fb7609d02cbf469cd83b8dd6c9d | [
"MIT"
] | 1 | 2021-03-24T17:53:33.000Z | 2021-03-24T17:53:33.000Z | test/testAll.py | slalom/sf-iot-hackathon | 89a1f147e1be7fb7609d02cbf469cd83b8dd6c9d | [
"MIT"
] | 8 | 2020-03-24T17:44:09.000Z | 2022-03-12T01:03:22.000Z | test/testAll.py | slalom/sf-iot-hackathon | 89a1f147e1be7fb7609d02cbf469cd83b8dd6c9d | [
"MIT"
] | 2 | 2021-03-24T17:53:37.000Z | 2022-03-07T10:34:00.000Z | import numpy as np
import predict
import os
import pandas as pd
directory = os.path.join(os.path.dirname(__file__), '..', 'chainsaw')
predictions = []
for file_name in os.listdir(directory):
(predicted_class, predicted_proba, le) = predict.predict(os.path.join(directory, file_name))
predictions.append(predicted_... | 27.0625 | 94 | 0.766744 | import numpy as np
import predict
import os
import pandas as pd
directory = os.path.join(os.path.dirname(__file__), '..', 'chainsaw')
predictions = []
for file_name in os.listdir(directory):
(predicted_class, predicted_proba, le) = predict.predict(os.path.join(directory, file_name))
predictions.append(predicted_... | 0 | 0 | 0 |
0631ebbbd9b2c4f8e2bea106ebd40a8d17921b3a | 8,524 | py | Python | spine/spine_adapter/kafka_client/kafka_async_consumer.py | ElasticRun/spine | 0be82de83d4117adeda62b75b8ea92b46c48b4f5 | [
"MIT"
] | null | null | null | spine/spine_adapter/kafka_client/kafka_async_consumer.py | ElasticRun/spine | 0be82de83d4117adeda62b75b8ea92b46c48b4f5 | [
"MIT"
] | null | null | null | spine/spine_adapter/kafka_client/kafka_async_consumer.py | ElasticRun/spine | 0be82de83d4117adeda62b75b8ea92b46c48b4f5 | [
"MIT"
] | null | null | null | import json, datetime
from confluent_kafka import Consumer, TopicPartition
from confluent_kafka.cimpl import KafkaError, KafkaException
import frappe
from frappe.utils.logger import get_logger
from spine.spine_adapter.scheduler.message_processor import process_message, skip_message
logger = None
| 52.617284 | 129 | 0.523346 | import json, datetime
from confluent_kafka import Consumer, TopicPartition
from confluent_kafka.cimpl import KafkaError, KafkaException
import frappe
from frappe.utils.logger import get_logger
from spine.spine_adapter.scheduler.message_processor import process_message, skip_message
logger = None
class KafkaAsyncSi... | 7,875 | 325 | 23 |
2062134262a738e7907debdbb289e19dca32fc00 | 779 | py | Python | indexdigest/test/linters/test_0094_generic_primary_key.py | macbre/index-digest | cb0c42f3905b608d58e1c214f461352b74aaa8df | [
"MIT"
] | 41 | 2017-10-25T11:52:50.000Z | 2022-02-10T07:18:06.000Z | indexdigest/test/linters/test_0094_generic_primary_key.py | macbre/index-digest | cb0c42f3905b608d58e1c214f461352b74aaa8df | [
"MIT"
] | 120 | 2017-09-28T17:07:52.000Z | 2022-03-31T03:20:55.000Z | indexdigest/test/linters/test_0094_generic_primary_key.py | macbre/index-digest | cb0c42f3905b608d58e1c214f461352b74aaa8df | [
"MIT"
] | 6 | 2017-11-09T19:52:44.000Z | 2022-03-15T09:44:18.000Z | from __future__ import print_function
from unittest import TestCase
from indexdigest.linters.linter_0094_generic_primary_key import check_generic_primary_key
from indexdigest.test import DatabaseTestMixin
| 35.409091 | 118 | 0.727856 | from __future__ import print_function
from unittest import TestCase
from indexdigest.linters.linter_0094_generic_primary_key import check_generic_primary_key
from indexdigest.test import DatabaseTestMixin
class TestLinter(TestCase, DatabaseTestMixin):
def test_generic_primary_key(self):
reports = list(... | 496 | 25 | 50 |
31ebda15ab201165720f5c2f2a7c623fb89ba4c5 | 3,242 | py | Python | huaweisms/api/common.py | growield/huawei-modem-py-api-client-through-proxy | 8cae130f43871938392292e527b79bb15f314fd3 | [
"MIT"
] | 1 | 2021-03-05T12:53:16.000Z | 2021-03-05T12:53:16.000Z | huaweisms/api/common.py | m-krasikov/huawei-modem-py-api-client-through-proxy | 8cae130f43871938392292e527b79bb15f314fd3 | [
"MIT"
] | null | null | null | huaweisms/api/common.py | m-krasikov/huawei-modem-py-api-client-through-proxy | 8cae130f43871938392292e527b79bb15f314fd3 | [
"MIT"
] | null | null | null | import logging
from typing import Union
from xml.dom.minidom import Element
import requests
from huaweisms.api.config import MODEM_HOST
from huaweisms.xml.util import get_child_text, parse_xml_string, get_dictionary_from_children
logger = logging.getLogger(__name__)
| 25.730159 | 110 | 0.637261 | import logging
from typing import Union
from xml.dom.minidom import Element
import requests
from huaweisms.api.config import MODEM_HOST
from huaweisms.xml.util import get_child_text, parse_xml_string, get_dictionary_from_children
logger = logging.getLogger(__name__)
class ApiCtx:
def __init__(self, modem_hos... | 2,597 | 182 | 184 |
af3c2f939f99c69f4eea7bf33ae27fcb67447244 | 1,022 | py | Python | tutorial/01.py | mssung94/daishin-trading-system | d6682495afb7a08e68db65537b1d1789f2996891 | [
"MIT"
] | 2 | 2020-11-21T08:45:26.000Z | 2020-11-21T08:50:56.000Z | tutorial/01.py | mssung94/daishin-trading-system | d6682495afb7a08e68db65537b1d1789f2996891 | [
"MIT"
] | null | null | null | tutorial/01.py | mssung94/daishin-trading-system | d6682495afb7a08e68db65537b1d1789f2996891 | [
"MIT"
] | null | null | null | # 대신증권 API
# 종목정보 구하는 예제
import win32com.client
# 연결 여부 체크
objCpCybos = win32com.client.Dispatch("CpUtil.CpCybos")
bConnect = objCpCybos.IsConnect
if (bConnect == 0):
print("PLUS가 정상적으로 연결되지 않음. ")
exit()
# 종목코드 리스트 구하기
objCpCodeMgr = win32com.client.Dispatch("CpUtil.CpCodeMgr")
codeList = objC... | 31.9375 | 60 | 0.716243 | # 대신증권 API
# 종목정보 구하는 예제
import win32com.client
# 연결 여부 체크
objCpCybos = win32com.client.Dispatch("CpUtil.CpCybos")
bConnect = objCpCybos.IsConnect
if (bConnect == 0):
print("PLUS가 정상적으로 연결되지 않음. ")
exit()
# 종목코드 리스트 구하기
objCpCodeMgr = win32com.client.Dispatch("CpUtil.CpCodeMgr")
codeList = objC... | 0 | 0 | 0 |
167f4d06a5733ff1010c2d3084136ed13d193765 | 391 | py | Python | chipy_org/apps/announcements/admin.py | SarthakAdhikari/chipy.org | e6ef9bce7b84cdcd3e98caf18f177c197666b819 | [
"MIT"
] | 88 | 2015-01-01T21:12:18.000Z | 2022-03-01T13:36:59.000Z | chipy_org/apps/announcements/admin.py | SarthakAdhikari/chipy.org | e6ef9bce7b84cdcd3e98caf18f177c197666b819 | [
"MIT"
] | 296 | 2015-01-02T15:55:19.000Z | 2022-03-20T20:11:47.000Z | chipy_org/apps/announcements/admin.py | SarthakAdhikari/chipy.org | e6ef9bce7b84cdcd3e98caf18f177c197666b819 | [
"MIT"
] | 83 | 2015-01-25T02:34:24.000Z | 2021-11-08T20:28:36.000Z | from django.contrib import admin
from .models import Announcement
admin.site.register(Announcement, AnnouncementAdmin)
| 21.722222 | 70 | 0.654731 | from django.contrib import admin
from .models import Announcement
class AnnouncementAdmin(admin.ModelAdmin):
list_display = ["id", "active", "end_date", "headline", "created"]
search_fields = [
"id",
"headline",
"body",
]
readonly_fields = ["created", "modified"]
list_filt... | 0 | 245 | 23 |
54efb5157a4e9a7c7c1f54fe09c587e62bc2bf7d | 2,493 | py | Python | app/utils/smmsPic.py | winlongit/shop_pc_server | 376fa5c0504e50a863aad68ead67e0a149ef5dd2 | [
"Apache-2.0"
] | 1 | 2021-12-08T13:59:32.000Z | 2021-12-08T13:59:32.000Z | app/utils/smmsPic.py | winlongit/shop_pc_server | 376fa5c0504e50a863aad68ead67e0a149ef5dd2 | [
"Apache-2.0"
] | null | null | null | app/utils/smmsPic.py | winlongit/shop_pc_server | 376fa5c0504e50a863aad68ead67e0a149ef5dd2 | [
"Apache-2.0"
] | 1 | 2021-12-08T13:59:34.000Z | 2021-12-08T13:59:34.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
@ Author : pengj
@ date : 2019/12/8 16:30
@ IDE : PyCharm
@ GitHub : https://github.com/JackyPJB
@ Contact : pengjianbiao@hotmail.com
----------------... | 34.625 | 83 | 0.525872 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
@ Author : pengj
@ date : 2019/12/8 16:30
@ IDE : PyCharm
@ GitHub : https://github.com/JackyPJB
@ Contact : pengjianbiao@hotmail.com
----------------... | 1,583 | 205 | 99 |
c8f76a05fe0a774394c6f6e98dca9fc237e5b68d | 23 | py | Python | HSVideo/__init__.py | jwbrooks0/johnspythonlibrary2 | 10ca519276d8c32da0fbd41a597f75c0c98a8736 | [
"MIT"
] | null | null | null | HSVideo/__init__.py | jwbrooks0/johnspythonlibrary2 | 10ca519276d8c32da0fbd41a597f75c0c98a8736 | [
"MIT"
] | null | null | null | HSVideo/__init__.py | jwbrooks0/johnspythonlibrary2 | 10ca519276d8c32da0fbd41a597f75c0c98a8736 | [
"MIT"
] | null | null | null | from ._hsvideo import * | 23 | 23 | 0.782609 | from ._hsvideo import * | 0 | 0 | 0 |
21228afac55a9c791bc277b714adaa2ceb8f75be | 6,862 | py | Python | examples/ggh/hashtree.py | Charterhouse/pysnark | 4d8ae194a918c57a84c9f42f2d9809d66e90f006 | [
"RSA-MD"
] | 65 | 2018-01-12T08:49:18.000Z | 2022-03-16T07:35:40.000Z | examples/ggh/hashtree.py | Charterhouse/pysnark | 4d8ae194a918c57a84c9f42f2d9809d66e90f006 | [
"RSA-MD"
] | 9 | 2018-01-19T21:14:02.000Z | 2019-10-15T09:48:01.000Z | examples/ggh/hashtree.py | Charterhouse/pysnark | 4d8ae194a918c57a84c9f42f2d9809d66e90f006 | [
"RSA-MD"
] | 13 | 2018-01-15T20:50:57.000Z | 2022-03-25T05:39:36.000Z | # Copyright (c) 2016-2018 Koninklijke Philips N.V. All rights reserved. A
# copyright license for redistribution and use in source and binary forms,
# with or without modification, is hereby granted for non-commercial,
# experimental and research purposes, provided that the following conditions
# are met:
# - Redistrib... | 36.695187 | 134 | 0.608277 | # Copyright (c) 2016-2018 Koninklijke Philips N.V. All rights reserved. A
# copyright license for redistribution and use in source and binary forms,
# with or without modification, is hereby granted for non-commercial,
# experimental and research purposes, provided that the following conditions
# are met:
# - Redistrib... | 1,322 | 0 | 161 |
6cc2ceecfbcb8b0abfe6e3345d5ae84e315b091d | 781 | py | Python | lib/bes/fs/find/file_type_criteria.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | lib/bes/fs/find/file_type_criteria.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | lib/bes/fs/find/file_type_criteria.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
import errno
from .criteria import criteria
from bes.fs import file_type
class file_type_criteria(criteria):
'match the file type.'
| 32.541667 | 94 | 0.710627 | #!/usr/bin/env python
#-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
import errno
from .criteria import criteria
from bes.fs import file_type
class file_type_criteria(criteria):
'match the file type.'
def __init__(self, file_type_mask):
super(file_type_criteria, se... | 480 | 0 | 52 |
4548d69878c60f6c4873b3a2043424cfc357800f | 979 | py | Python | tests/test_rotation_queue.py | und3v3l0p3d/asyncio-rotation | 5ea85e01d1c71034c4f0396a3ef77916e236da37 | [
"MIT"
] | null | null | null | tests/test_rotation_queue.py | und3v3l0p3d/asyncio-rotation | 5ea85e01d1c71034c4f0396a3ef77916e236da37 | [
"MIT"
] | null | null | null | tests/test_rotation_queue.py | und3v3l0p3d/asyncio-rotation | 5ea85e01d1c71034c4f0396a3ef77916e236da37 | [
"MIT"
] | null | null | null | import pytest
import random
from asyncio_queue_rotation import RotationQueue
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
| 25.763158 | 74 | 0.694586 | import pytest
import random
from asyncio_queue_rotation import RotationQueue
@pytest.mark.asyncio
async def test_rotation_queue_is_empty():
rotation_queue = RotationQueue(1)
await rotation_queue.put(1)
await rotation_queue.get()
assert rotation_queue.empty(), 'Queue not empty'
@pytest.mark.asyncio
a... | 767 | 0 | 66 |
edd23128c06a2cb8df7a1ce6bbcfcd35d25f04e0 | 87 | py | Python | lta/helpers/__init__.py | IMS-Bio2Core-Facility/lta | 79078a0daa05ee81c97612056ee2151c9b8a6ce7 | [
"MIT"
] | 1 | 2021-12-22T20:29:22.000Z | 2021-12-22T20:29:22.000Z | lta/helpers/__init__.py | IMS-Bio2Core-Facility/lta | 79078a0daa05ee81c97612056ee2151c9b8a6ce7 | [
"MIT"
] | 19 | 2021-12-23T15:50:25.000Z | 2022-02-15T16:57:49.000Z | lta/helpers/__init__.py | IMS-Bio2Core-Facility/lta | 79078a0daa05ee81c97612056ee2151c9b8a6ce7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Helper functions and classes for the LTA CLI and parser."""
| 29 | 62 | 0.643678 | # -*- coding: utf-8 -*-
"""Helper functions and classes for the LTA CLI and parser."""
| 0 | 0 | 0 |
62da6c36cd521e0748f9ef7ad1c3ab3e57dcf136 | 2,613 | py | Python | cfgov/cal/forms.py | Mario-Kart-Felix/cfgov-refresh | 7978fedeb7aaf4d96a87720e6545567085e056a9 | [
"CC0-1.0"
] | 1 | 2019-12-29T17:50:07.000Z | 2019-12-29T17:50:07.000Z | cfgov/cal/forms.py | ascott1/cfgov-refresh | 9c916aaed3a48110a199eb4675474290a51f815d | [
"CC0-1.0"
] | 1 | 2021-04-22T01:09:52.000Z | 2021-04-22T01:09:52.000Z | cfgov/cal/forms.py | ascott1/cfgov-refresh | 9c916aaed3a48110a199eb4675474290a51f815d | [
"CC0-1.0"
] | 1 | 2021-02-02T08:59:38.000Z | 2021-02-02T08:59:38.000Z | from django import forms
from cal.models import CFPBCalendar
from sheerlike.templates import get_date_string
from v1.util.util import ERROR_MESSAGES
| 32.6625 | 73 | 0.641408 | from django import forms
from cal.models import CFPBCalendar
from sheerlike.templates import get_date_string
from v1.util.util import ERROR_MESSAGES
class FilterErrorList(forms.utils.ErrorList):
def __str__(self):
return '\n'.join(str(e) for e in self)
class FilterCheckboxList(forms.MultipleChoiceField... | 1,637 | 575 | 246 |
19552a449e41734a2151ac275f79c06c4e6e0248 | 1,363 | py | Python | docs/_static/demos/filters/FilterBySequenceRegexDemo.ipynb.py | sbliven/mmtf-pyspark | 3d444178bdc0d5128aafdb1326fec12b5d7634b5 | [
"Apache-2.0"
] | 59 | 2018-01-28T06:50:56.000Z | 2022-02-10T06:07:12.000Z | docs/_static/demos/filters/FilterBySequenceRegexDemo.ipynb.py | sbliven/mmtf-pyspark | 3d444178bdc0d5128aafdb1326fec12b5d7634b5 | [
"Apache-2.0"
] | 101 | 2018-02-01T20:51:10.000Z | 2022-01-24T00:50:29.000Z | docs/_static/demos/filters/FilterBySequenceRegexDemo.ipynb.py | sbliven/mmtf-pyspark | 3d444178bdc0d5128aafdb1326fec12b5d7634b5 | [
"Apache-2.0"
] | 29 | 2018-01-29T10:09:51.000Z | 2022-01-23T18:53:28.000Z |
# coding: utf-8
# # Filter By Sequence Regex Demo
#
# This example shows how to filter poteins by their sequence regualar expression.
#
# [More about regular expression](https://www.regular-expressions.info)
#
# ## Imports
# In[1]:
from pyspark import SparkConf, SparkContext
from mmtfPyspark.io import mmtfRead... | 17.474359 | 99 | 0.694057 |
# coding: utf-8
# # Filter By Sequence Regex Demo
#
# This example shows how to filter poteins by their sequence regualar expression.
#
# [More about regular expression](https://www.regular-expressions.info)
#
# ## Imports
# In[1]:
from pyspark import SparkConf, SparkContext
from mmtfPyspark.io import mmtfRead... | 0 | 0 | 0 |
d6beaee48ce4eb34bd0cec140cc6cf639bbc3cba | 812 | py | Python | solutions/insert-interval.py | edab/-LC_StudyPlan_Python | e065f0ced68d23800d7b5001102c2e930ee35e23 | [
"MIT"
] | null | null | null | solutions/insert-interval.py | edab/-LC_StudyPlan_Python | e065f0ced68d23800d7b5001102c2e930ee35e23 | [
"MIT"
] | 1 | 2022-02-22T15:42:54.000Z | 2022-02-25T00:10:04.000Z | solutions/insert-interval.py | edab/-LC_StudyPlan_Python | e065f0ced68d23800d7b5001102c2e930ee35e23 | [
"MIT"
] | null | null | null | # Leetcode 57. Insert Interval
#
# Link: https://leetcode.com/problems/insert-interval/
# Difficulty: Medium
# Solution using DP.
# Complexity:
# O(N) time | where N represent the number of intervals
# O(1) space
| 24.606061 | 106 | 0.591133 | # Leetcode 57. Insert Interval
#
# Link: https://leetcode.com/problems/insert-interval/
# Difficulty: Medium
# Solution using DP.
# Complexity:
# O(N) time | where N represent the number of intervals
# O(1) space
class Solution:
def insert(self, intervals: List[List[int]], newInterval: List[int]) -> List[List[... | 552 | -6 | 48 |
85002a8f81bc914a0a8bf332961d866820ac2fc2 | 6,604 | py | Python | daemon_with_access_token.py | cBashTN/Kolibri-Cloud-API-daemon-example-with-access-token | d1aa2b550d57f17851c540ab5d953f66001b8c81 | [
"MIT"
] | null | null | null | daemon_with_access_token.py | cBashTN/Kolibri-Cloud-API-daemon-example-with-access-token | d1aa2b550d57f17851c540ab5d953f66001b8c81 | [
"MIT"
] | null | null | null | daemon_with_access_token.py | cBashTN/Kolibri-Cloud-API-daemon-example-with-access-token | d1aa2b550d57f17851c540ab5d953f66001b8c81 | [
"MIT"
] | null | null | null | # This Python file uses the following encoding: utf-8
# ##############################################################################
# KOLIBRI CLOUD API DAEMON EXAMPLE WITH ACCESS TOKEN #
# #
# Needs: ... | 43.163399 | 212 | 0.573137 | # This Python file uses the following encoding: utf-8
# ##############################################################################
# KOLIBRI CLOUD API DAEMON EXAMPLE WITH ACCESS TOKEN #
# #
# Needs: ... | 1,976 | 0 | 46 |
a6cacc7ea2347d3e08ff074df169e0ab58f5ec25 | 2,416 | py | Python | mysite/pynny/templatetags/pynny_extras.py | zach-king/Pynny | 3dac355092084385c673fd94ef9693f046a835a0 | [
"MIT"
] | null | null | null | mysite/pynny/templatetags/pynny_extras.py | zach-king/Pynny | 3dac355092084385c673fd94ef9693f046a835a0 | [
"MIT"
] | 42 | 2017-09-05T02:38:08.000Z | 2021-06-10T18:32:57.000Z | mysite/pynny/templatetags/pynny_extras.py | zcking/Pynny | 3dac355092084385c673fd94ef9693f046a835a0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''
File: template_filters.py
Author: Zachary King
Implements custom Django template filters to be used
in Django templates.
'''
from django.template.defaultfilters import register
from datetime import date, datetime
from decimal import Decimal
@register.simple_tag
@register.simple_tag
@... | 23.686275 | 78 | 0.649834 | #!/usr/bin/env python3
'''
File: template_filters.py
Author: Zachary King
Implements custom Django template filters to be used
in Django templates.
'''
from django.template.defaultfilters import register
from datetime import date, datetime
from decimal import Decimal
@register.simple_tag
def saving_class(saving):
... | 948 | 0 | 154 |
8139cb12d7124b9102439c462cc50689661fc1f7 | 804 | py | Python | ML/50-mlps/04-keras-1000-epochs/create_validation_curve.py | PepSalehi/algorithms | 1c20f57185e6324aa840ccff98e69764b4213131 | [
"MIT"
] | null | null | null | ML/50-mlps/04-keras-1000-epochs/create_validation_curve.py | PepSalehi/algorithms | 1c20f57185e6324aa840ccff98e69764b4213131 | [
"MIT"
] | null | null | null | ML/50-mlps/04-keras-1000-epochs/create_validation_curve.py | PepSalehi/algorithms | 1c20f57185e6324aa840ccff98e69764b4213131 | [
"MIT"
] | 1 | 2019-12-09T21:40:46.000Z | 2019-12-09T21:40:46.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Visualize validation curve."""
import pandas as pd
import matplotlib.pyplot as plt
Y_SCALE_FACTOR = 100
# Prepare dataframe
df = pd.read_csv('log.csv', sep=';')
df = df[['epoch', 'acc', 'val_acc']]
df[['acc', 'val_acc']] = df[['acc', 'val_acc']] * Y_SCALE_FACTOR
df =... | 28.714286 | 77 | 0.619403 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Visualize validation curve."""
import pandas as pd
import matplotlib.pyplot as plt
Y_SCALE_FACTOR = 100
# Prepare dataframe
df = pd.read_csv('log.csv', sep=';')
df = df[['epoch', 'acc', 'val_acc']]
df[['acc', 'val_acc']] = df[['acc', 'val_acc']] * Y_SCALE_FACTOR
df =... | 0 | 0 | 0 |
0eae3be1ede6942cfdb4f2d7482c3a67099fb9a2 | 2,633 | py | Python | tools/dockerize/webportal/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/protocols/amqp/opts.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | 1 | 2019-09-11T11:56:19.000Z | 2019-09-11T11:56:19.000Z | tools/dockerize/webportal/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/protocols/amqp/opts.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | tools/dockerize/webportal/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/protocols/amqp/opts.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | # Copyright 2014, Red Hat, 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 ... | 35.581081 | 79 | 0.600836 | # Copyright 2014, Red Hat, 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 ... | 0 | 0 | 0 |
714ab47942c46cc7c1af50657246bfe244f16999 | 10,858 | py | Python | labinform/datasafe/datasafe.py | tillbiskup/labinform | be483786e43abd579f7b3622e4a6be900d5823e2 | [
"BSD-2-Clause"
] | null | null | null | labinform/datasafe/datasafe.py | tillbiskup/labinform | be483786e43abd579f7b3622e4a6be900d5823e2 | [
"BSD-2-Clause"
] | null | null | null | labinform/datasafe/datasafe.py | tillbiskup/labinform | be483786e43abd579f7b3622e4a6be900d5823e2 | [
"BSD-2-Clause"
] | null | null | null | """Datasafe module for the labinform package.
The datasafe is a key feature of labinform which serves to safely store data.
Functionality includes directory generation and checksum creation.
"""
import os
import hashlib
import shutil
class Error(Exception):
"""Base class for exceptions in this module."""
p... | 29.032086 | 79 | 0.586112 | """Datasafe module for the labinform package.
The datasafe is a key feature of labinform which serves to safely store data.
Functionality includes directory generation and checksum creation.
"""
import os
import hashlib
import shutil
class Error(Exception):
"""Base class for exceptions in this module."""
p... | 298 | 0 | 84 |
67982a1010d5c17191a807f093238593ff6f4487 | 691 | py | Python | IRIS Flower Classification Project/main.py | jrderek/Machine-Learning-projects | b98eaace9a8e14d448a5fc1940779a19fe74dd68 | [
"MIT"
] | 2 | 2020-12-05T08:38:57.000Z | 2020-12-22T11:44:38.000Z | main.py | itzanuragsinghania/IRIS-Flower-Classification | a66e5577a371f44b6993ad2c909ce5acc77534c9 | [
"MIT"
] | null | null | null | main.py | itzanuragsinghania/IRIS-Flower-Classification | a66e5577a371f44b6993ad2c909ce5acc77534c9 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, url_for, request
import numpy as np
from sklearn.externals import joblib
app = Flask(__name__)
filename = './data/model.sav'
model = joblib.load(filename)
@app.route("/")
@app.route("/index.html")
@app.route("/", methods=['POST'])
| 27.64 | 59 | 0.7178 | from flask import Flask, render_template, url_for, request
import numpy as np
from sklearn.externals import joblib
app = Flask(__name__)
filename = './data/model.sav'
model = joblib.load(filename)
def find_species(a,b,c,d):
return model.predict(np.array([a,b,c,d]).reshape(1,-1))[0]
@app.route("/")
@app.route("/inde... | 348 | 0 | 67 |
0a9f6e6dcbf2c8da7b4de29c02434702347b60e4 | 4,670 | py | Python | xlsxwriter/test/worksheet/test_worksheet06.py | edparcell/XlsxWriter | d6a5df232ac0091017ae5c65f592bcc776d296ea | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2019-01-09T19:43:43.000Z | 2019-01-09T19:43:43.000Z | xlsxwriter/test/worksheet/test_worksheet06.py | edparcell/XlsxWriter | d6a5df232ac0091017ae5c65f592bcc776d296ea | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/worksheet/test_worksheet06.py | edparcell/XlsxWriter | d6a5df232ac0091017ae5c65f592bcc776d296ea | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2018, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet import Worksheet
from ...shareds... | 33.597122 | 171 | 0.557173 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2018, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet import Worksheet
from ...shareds... | 0 | 0 | 0 |
d8567e47cb7ba08033e9c8cff59fab6971372385 | 1,372 | py | Python | allure-pytest/test/fixtures/module_scope/fixtures_simple_test.py | vdsbenoit/allure-python | 7b56b031c42369dd73844105382e9ceb9a88d6cd | [
"Apache-2.0"
] | 1 | 2021-02-19T21:00:11.000Z | 2021-02-19T21:00:11.000Z | allure-pytest/test/fixtures/module_scope/fixtures_simple_test.py | vdsbenoit/allure-python | 7b56b031c42369dd73844105382e9ceb9a88d6cd | [
"Apache-2.0"
] | null | null | null | allure-pytest/test/fixtures/module_scope/fixtures_simple_test.py | vdsbenoit/allure-python | 7b56b031c42369dd73844105382e9ceb9a88d6cd | [
"Apache-2.0"
] | 1 | 2020-08-05T05:40:44.000Z | 2020-08-05T05:40:44.000Z | import pytest
@pytest.fixture(scope='module')
def test_module_scope_simple_fixture(module_scope_simple_fixture):
"""
>>> allure_report = getfixture('allure_report')
>>> assert_that(allure_report,
... has_test_case('test_module_scope_simple_fixture',
... has_... | 31.906977 | 89 | 0.509475 | import pytest
@pytest.fixture(scope='module')
def module_scope_simple_fixture():
pass
def test_module_scope_simple_fixture(module_scope_simple_fixture):
"""
>>> allure_report = getfixture('allure_report')
>>> assert_that(allure_report,
... has_test_case('test_module_scope_simple_fixt... | 22 | 0 | 22 |