hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
debc1fbbc2265a759c75b70c32551eb82dc91688 | 449 | py | Python | setup.py | ZenMX/bert4keras | 8ffb46a16a79f87aa8cdf045df7994036b4be47d | [
"Apache-2.0"
] | 1 | 2020-08-24T13:42:49.000Z | 2020-08-24T13:42:49.000Z | setup.py | ZenMX/bert4keras | 8ffb46a16a79f87aa8cdf045df7994036b4be47d | [
"Apache-2.0"
] | null | null | null | setup.py | ZenMX/bert4keras | 8ffb46a16a79f87aa8cdf045df7994036b4be47d | [
"Apache-2.0"
] | 1 | 2021-01-07T12:00:39.000Z | 2021-01-07T12:00:39.000Z | #! -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='bert4keras',
version='0.8.5',
description='an elegant bert4keras',
long_description='bert4keras: https://github.com/bojone/bert4keras',
license='Apache License 2.0',
url='https://github.com/bojone/bert4keras',
... | 26.411765 | 72 | 0.674833 |
561922a62fe84f59f2163817321c2ffe8e0e93a9 | 119 | py | Python | producto/admin.py | JohanVasquez/crud-venta-libre | 557f82b5d88c42480020a65cc6034348ff20efce | [
"MIT"
] | null | null | null | producto/admin.py | JohanVasquez/crud-venta-libre | 557f82b5d88c42480020a65cc6034348ff20efce | [
"MIT"
] | null | null | null | producto/admin.py | JohanVasquez/crud-venta-libre | 557f82b5d88c42480020a65cc6034348ff20efce | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
from .models import Ventas
admin.site.register(Ventas)
| 17 | 32 | 0.798319 |
c2582a5089aa76a4898cf61bc983b8eedce5f624 | 2,352 | py | Python | tests/test_site/settings.py | tredzko/python-django | 0e39eacc2740be5d9620482119c3e9d41bc77ec8 | [
"BSD-3-Clause"
] | 103 | 2016-07-21T10:11:43.000Z | 2021-11-15T09:52:49.000Z | tests/test_site/settings.py | tredzko/python-django | 0e39eacc2740be5d9620482119c3e9d41bc77ec8 | [
"BSD-3-Clause"
] | 51 | 2016-11-28T20:01:47.000Z | 2022-01-27T15:49:17.000Z | tests/test_site/settings.py | tredzko/python-django | 0e39eacc2740be5d9620482119c3e9d41bc77ec8 | [
"BSD-3-Clause"
] | 64 | 2016-11-28T14:08:06.000Z | 2021-12-11T11:16:50.000Z | """
Django settings for opentracing_test_site project.
Generated by 'django-admin startproject' using Django 1.9.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""... | 29.037037 | 71 | 0.728741 |
bb4aeb9eb590ac8c74c30568d3fd8b51b26d49f6 | 22,019 | py | Python | pyani/pyani_orm.py | widdowquinn/pyani | 14a96f30ccebef64d8945e9abf58dc2517ee478b | [
"MIT"
] | 144 | 2015-02-16T11:34:28.000Z | 2022-03-17T09:03:52.000Z | pyani/pyani_orm.py | HuttonICS/pyani | 14a96f30ccebef64d8945e9abf58dc2517ee478b | [
"MIT"
] | 331 | 2015-06-04T16:25:53.000Z | 2022-03-31T05:24:11.000Z | pyani/pyani_orm.py | HuttonICS/pyani | 14a96f30ccebef64d8945e9abf58dc2517ee478b | [
"MIT"
] | 61 | 2015-06-03T00:28:19.000Z | 2022-02-15T08:47:57.000Z | # -*- coding: utf-8 -*-
# (c) The James Hutton Institute 2018-2019
# (c) The University of Strathclyde 2019-2020
# Author: Leighton Pritchard
#
# Contact:
# leighton.pritchard@strath.ac.uk
#
# Leighton Pritchard,
# Strathclyde Institute of Pharmacy and Biomedical Sciences
# University of Strathclyde
# 161 Cathedral Str... | 35.978758 | 93 | 0.660793 |
bc3846533f2b5a9312e69cffa6859ba819e0236f | 2,758 | py | Python | model_zoo/wide_and_deep/eval.py | wudenggang/mindspore | 95e75c3119909cc5c7c3098232851d1d7bc4ef8c | [
"Apache-2.0"
] | null | null | null | model_zoo/wide_and_deep/eval.py | wudenggang/mindspore | 95e75c3119909cc5c7c3098232851d1d7bc4ef8c | [
"Apache-2.0"
] | null | null | null | model_zoo/wide_and_deep/eval.py | wudenggang/mindspore | 95e75c3119909cc5c7c3098232851d1d7bc4ef8c | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 28.729167 | 96 | 0.70087 |
4caed4f5599e3832a7b674f99427c51f03a36c31 | 73,714 | py | Python | django/db/models/fields/related.py | adambrenecki/django | 28a571348bca9c5a3c137e495e7d3c9349a5bd56 | [
"BSD-3-Clause"
] | 1 | 2020-02-08T11:04:08.000Z | 2020-02-08T11:04:08.000Z | django/db/models/fields/related.py | adambrenecki/django | 28a571348bca9c5a3c137e495e7d3c9349a5bd56 | [
"BSD-3-Clause"
] | null | null | null | django/db/models/fields/related.py | adambrenecki/django | 28a571348bca9c5a3c137e495e7d3c9349a5bd56 | [
"BSD-3-Clause"
] | null | null | null | from operator import attrgetter
from django.db import connection, connections, router
from django.db.backends import util
from django.db.models import signals
from django.db.models.fields import (AutoField, Field, IntegerField,
PositiveIntegerField, PositiveSmallIntegerField, FieldDoesNotExist)
from django.db.mode... | 46.772843 | 228 | 0.630369 |
dc190f9b6feda41e3b9eaac02f5051d0598853fc | 2,357 | py | Python | a2c_ppo_acktr/algo/sog/block_coordinate_search.py | ArashVahabpour/sog-gail | 90ebdc5a051a015f3b6c801d4b16307d2fbac0ae | [
"MIT"
] | null | null | null | a2c_ppo_acktr/algo/sog/block_coordinate_search.py | ArashVahabpour/sog-gail | 90ebdc5a051a015f3b6c801d4b16307d2fbac0ae | [
"MIT"
] | null | null | null | a2c_ppo_acktr/algo/sog/block_coordinate_search.py | ArashVahabpour/sog-gail | 90ebdc5a051a015f3b6c801d4b16307d2fbac0ae | [
"MIT"
] | null | null | null | import torch
import itertools
from .base_search import BaseSearch
class BlockCoordinateSearch(BaseSearch):
"""
Block coordinate grid search optimizer over the distribution of points
in the latent space.
"""
def __init__(self, actor_critic, args):
super().__init__(actor_critic, args)
... | 36.261538 | 110 | 0.615613 |
402dd9173e8abfcceba800118850eec309d23372 | 1,233 | py | Python | example.py | tjddn2615/GazeTracking | 60ef5f5797cb9a61f42bb0257800b2de0de40bce | [
"MIT"
] | 4 | 2020-08-19T10:24:45.000Z | 2020-08-19T13:42:27.000Z | example.py | tjddn2615/GazeTracking | 60ef5f5797cb9a61f42bb0257800b2de0de40bce | [
"MIT"
] | null | null | null | example.py | tjddn2615/GazeTracking | 60ef5f5797cb9a61f42bb0257800b2de0de40bce | [
"MIT"
] | null | null | null | """
Demonstration of the GazeTracking library.
Check the README.md for complete documentation.
"""
import cv2
from gaze_tracking import GazeTracking
gaze = GazeTracking()
webcam = cv2.VideoCapture(0)
while True:
# We get a new frame from the webcam
_, frame = webcam.read()
# We send this frame to GazeTr... | 25.6875 | 117 | 0.635036 |
3fb67869634239a005f645848740820bee35f6b4 | 11,331 | py | Python | pybind/nos/v7_1_0/interface/gigabitethernet/ipv6/ipv6_nd_ra/ipv6_intf_cmds/nd/dad/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/interface/gigabitethernet/ipv6/ipv6_nd_ra/ipv6_intf_cmds/nd/dad/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/interface/gigabitethernet/ipv6/ipv6_nd_ra/ipv6_intf_cmds/nd/dad/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 71.71519 | 789 | 0.72915 |
961398d791e512712f8fcf023ccab17c8cbaa299 | 120 | py | Python | mmdet/datasets/samplers/__init__.py | Qianna00/InstanceLoc | de6bf95f482c04f3b9af4434feff6a38646e0a87 | [
"Apache-2.0"
] | 120 | 2021-02-16T12:06:05.000Z | 2022-03-30T03:38:37.000Z | mmdet/datasets/samplers/__init__.py | Qianna00/InstanceLoc | de6bf95f482c04f3b9af4434feff6a38646e0a87 | [
"Apache-2.0"
] | 19 | 2021-02-22T12:52:31.000Z | 2022-03-07T12:04:03.000Z | mmdet/datasets/samplers/__init__.py | Qianna00/InstanceLoc | de6bf95f482c04f3b9af4434feff6a38646e0a87 | [
"Apache-2.0"
] | 9 | 2021-02-22T02:35:20.000Z | 2022-02-25T05:38:52.000Z | from .group_sampler import DistributedGroupSampler, GroupSampler
__all__ = ['DistributedGroupSampler', 'GroupSampler']
| 30 | 64 | 0.833333 |
f8faeacc525124fa9bfeb2eef9202fd41b303fc4 | 13,222 | py | Python | CodeMapping/CodeWrapper.py | ArielBlG/stackoverflow_mapping | 203f0da09f2190578b83b3c885c57e58e0234573 | [
"MIT"
] | null | null | null | CodeMapping/CodeWrapper.py | ArielBlG/stackoverflow_mapping | 203f0da09f2190578b83b3c885c57e58e0234573 | [
"MIT"
] | null | null | null | CodeMapping/CodeWrapper.py | ArielBlG/stackoverflow_mapping | 203f0da09f2190578b83b3c885c57e58e0234573 | [
"MIT"
] | null | null | null | import stackoverflow_java_queries
# from googlesearch import search
class Task:
def __init__(self):
"""
Task Constructor - object that holds the task attribute.
"""
self.task = None
self.key = 0
self.documentation = ""
self.code = None
self.code_c... | 28.373391 | 102 | 0.568447 |
df8424f222409c2cd454068f3ca5a2c343650c81 | 2,113 | py | Python | _scripts/make_committees_data.py | GCCR/GCCR.github.io | 9400e64ee1eb618bfaeaf7a1c927a04165db191b | [
"MIT"
] | 5 | 2020-03-27T20:01:18.000Z | 2021-06-06T12:41:20.000Z | _scripts/make_committees_data.py | GCCR/GCCR.github.io | 9400e64ee1eb618bfaeaf7a1c927a04165db191b | [
"MIT"
] | 39 | 2020-04-01T23:55:10.000Z | 2022-02-26T07:09:57.000Z | _scripts/make_committees_data.py | GCCR/GCCR.github.io | 9400e64ee1eb618bfaeaf7a1c927a04165db191b | [
"MIT"
] | 3 | 2020-03-29T16:06:02.000Z | 2020-04-07T19:23:37.000Z | import os
import re
import logging
import pandas as pd
from googleapiclient.discovery import build
import yaml
logging.getLogger('googleapiclient.discovery_cache').setLevel(logging.ERROR)
# load personal websites
with open("_data/websites.yml", "r") as f:
WEBSITES = yaml.load(f, Loader=yaml.BaseLoader)
def membe... | 32.015152 | 76 | 0.648367 |
c6055a2d2fc16d09a29485623dcb97126921071e | 415 | py | Python | frille-lang/lib/python3.6/site-packages/srsly/tests/msgpack/test_subtype.py | frillecode/CDS-spring-2021-language | a0b2116044cd20d4a34b98f23bd2663256c90c5d | [
"MIT"
] | 10 | 2021-05-31T07:18:08.000Z | 2022-03-19T09:20:11.000Z | frille-lang/lib/python3.6/site-packages/srsly/tests/msgpack/test_subtype.py | frillecode/CDS-spring-2021-language | a0b2116044cd20d4a34b98f23bd2663256c90c5d | [
"MIT"
] | 4 | 2021-06-02T00:49:27.000Z | 2022-01-13T01:59:34.000Z | frille-lang/lib/python3.6/site-packages/srsly/tests/msgpack/test_subtype.py | frillecode/CDS-spring-2021-language | a0b2116044cd20d4a34b98f23bd2663256c90c5d | [
"MIT"
] | 2 | 2021-12-09T07:23:21.000Z | 2022-03-31T06:13:10.000Z | #!/usr/bin/env python
# coding: utf-8
from ...msgpack import packb, unpackb
from collections import namedtuple
class MyList(list):
pass
class MyDict(dict):
pass
class MyTuple(tuple):
pass
MyNamedTuple = namedtuple('MyNamedTuple', 'x y')
def test_types():
assert packb(MyDict()) == packb(dict())
... | 18.863636 | 53 | 0.66747 |
27d756536e47782ac79ca97c25233df65996839b | 7,867 | py | Python | seamm_dashboard/__init__.py | paulsaxe/seamm_dashboard | 66049c8c58fd34af3bd143157d0138e8fb737f9b | [
"BSD-3-Clause"
] | null | null | null | seamm_dashboard/__init__.py | paulsaxe/seamm_dashboard | 66049c8c58fd34af3bd143157d0138e8fb737f9b | [
"BSD-3-Clause"
] | null | null | null | seamm_dashboard/__init__.py | paulsaxe/seamm_dashboard | 66049c8c58fd34af3bd143157d0138e8fb737f9b | [
"BSD-3-Clause"
] | null | null | null | import logging
import os
from pathlib import Path
import connexion
# from flask_admin import Admin
from flask_debugtoolbar import DebugToolbarExtension
from flask_bootstrap import Bootstrap
from flask_cors import CORS
from flask_mail import Mail
from flask_moment import Moment
from flask_sqlalchemy import SQLAlchemy
... | 32.508264 | 85 | 0.66048 |
b4614af266cc48e90173a3bf20f9e343ed9f82fc | 2,816 | py | Python | scraper/proxy.py | FTJiang/Scraper-for-Stackoverflow | 7a482ab853a3b0f3092a3e41ac36395c7f89cb2e | [
"MIT"
] | 1 | 2019-01-15T07:44:38.000Z | 2019-01-15T07:44:38.000Z | scraper/proxy.py | FTJiang/Scraper-for-Stackoverflow | 7a482ab853a3b0f3092a3e41ac36395c7f89cb2e | [
"MIT"
] | null | null | null | scraper/proxy.py | FTJiang/Scraper-for-Stackoverflow | 7a482ab853a3b0f3092a3e41ac36395c7f89cb2e | [
"MIT"
] | null | null | null | import urllib2
import urllib
from bs4 import BeautifulSoup
import RandomAgent
import os
import socket
#function used to get IP, port and type of proxies from website, stored in file named prxy_ip.txt
def getProxyFile():
url = "https://hidemy.name/en/proxy-list"
#temp = "'User-Agent':"+'\''+RandomAgent.Agent()+'\''
... | 26.074074 | 119 | 0.669034 |
5fece72ccddcab69b360820607c782544be531da | 153,373 | py | Python | pandas/core/series.py | Muktan/pandas | ffa6e20d7dadd262d9035a647dffed9903fc5929 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/series.py | Muktan/pandas | ffa6e20d7dadd262d9035a647dffed9903fc5929 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/series.py | Muktan/pandas | ffa6e20d7dadd262d9035a647dffed9903fc5929 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | """
Data structure for 1-dimensional cross-sectional and time series data
"""
from __future__ import annotations
from io import StringIO
from shutil import get_terminal_size
from textwrap import dedent
from typing import (
IO,
TYPE_CHECKING,
Any,
Callable,
Hashable,
Iterable,
List,
Opti... | 30.388944 | 88 | 0.532734 |
a9324c82459b40cd90840217797e9deb5261dfad | 917 | py | Python | corehq/sql_db/management/commands/locate_invalid_shard_data.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 471 | 2015-01-10T02:55:01.000Z | 2022-03-29T18:07:18.000Z | corehq/sql_db/management/commands/locate_invalid_shard_data.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 14,354 | 2015-01-01T07:38:23.000Z | 2022-03-31T20:55:14.000Z | corehq/sql_db/management/commands/locate_invalid_shard_data.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 175 | 2015-01-06T07:16:47.000Z | 2022-03-29T13:27:01.000Z | from django.core.management.base import BaseCommand
from corehq.sql_db.shard_data_management import get_count_of_unmatched_models_by_shard
from corehq.sql_db.util import get_db_aliases_for_partitioned_query, get_all_sharded_models
class Command(BaseCommand):
help = "Print out all shard data that exists in databas... | 48.263158 | 104 | 0.676118 |
f9b39604a020a4f9cef5de9be79129b055914837 | 561 | py | Python | output/models/nist_data/atomic/time/schema_instance/nistschema_sv_iv_atomic_time_max_exclusive_4_xsd/nistschema_sv_iv_atomic_time_max_exclusive_4.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/atomic/time/schema_instance/nistschema_sv_iv_atomic_time_max_exclusive_4_xsd/nistschema_sv_iv_atomic_time_max_exclusive_4.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/atomic/time/schema_instance/nistschema_sv_iv_atomic_time_max_exclusive_4_xsd/nistschema_sv_iv_atomic_time_max_exclusive_4.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import Optional
from xsdata.models.datatype import XmlTime
__NAMESPACE__ = "NISTSchema-SV-IV-atomic-time-maxExclusive-4-NS"
@dataclass
class NistschemaSvIvAtomicTimeMaxExclusive4:
class Meta:
name = "NISTSchema-SV-IV-atomic-time-maxExclusive-4"
... | 26.714286 | 68 | 0.677362 |
e12713baf0d04aa62a6c710a0a6560119839e8fd | 156 | py | Python | joblicant/JoblicantApp/apps.py | juliuscecilia33/joblicant | b654bc438838f633556cef16fa7e5bfa63eecfb6 | [
"MIT"
] | null | null | null | joblicant/JoblicantApp/apps.py | juliuscecilia33/joblicant | b654bc438838f633556cef16fa7e5bfa63eecfb6 | [
"MIT"
] | null | null | null | joblicant/JoblicantApp/apps.py | juliuscecilia33/joblicant | b654bc438838f633556cef16fa7e5bfa63eecfb6 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class JoblicantappConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'JoblicantApp'
| 22.285714 | 56 | 0.775641 |
4bd7a98cb924a45ff60f4908627c386b20d9cbde | 8,141 | py | Python | python/paddle/fluid/tests/unittests/test_layer_norm_op.py | javakian/Paddle | 10018f1561cb8f75f8df982dcf2217e50cee2647 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_layer_norm_op.py | javakian/Paddle | 10018f1561cb8f75f8df982dcf2217e50cee2647 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_layer_norm_op.py | javakian/Paddle | 10018f1561cb8f75f8df982dcf2217e50cee2647 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 37.689815 | 80 | 0.549932 |
6a2230920e6b1ada69ea5f060fe9b304e57ab86c | 4,950 | py | Python | wagtailmedia/models.py | cca/wagtailmedia | 65bfb904a696185bd8eee003e19c74a20ea04827 | [
"BSD-3-Clause"
] | null | null | null | wagtailmedia/models.py | cca/wagtailmedia | 65bfb904a696185bd8eee003e19c74a20ea04827 | [
"BSD-3-Clause"
] | null | null | null | wagtailmedia/models.py | cca/wagtailmedia | 65bfb904a696185bd8eee003e19c74a20ea04827 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import mimetypes
import os.path
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.validators import MinValueValidator
from django.db import models
from django.dispatch import Signal
from django.urls import reverse
from dja... | 27.5 | 87 | 0.656162 |
1673a35b740cfe55b5f9f7a1849414a55b1d27f5 | 1,554 | py | Python | cloudify_rest_client/workflows.py | mistio/cloudify-common | 3b706ba31a3371052fbdd12486d4a0befbcf491b | [
"Apache-2.0"
] | 6 | 2018-10-13T20:36:40.000Z | 2021-07-04T17:19:13.000Z | cloudify_rest_client/workflows.py | mistio/cloudify-common | 3b706ba31a3371052fbdd12486d4a0befbcf491b | [
"Apache-2.0"
] | 97 | 2018-05-25T12:10:19.000Z | 2022-03-30T10:16:40.000Z | cloudify_rest_client/workflows.py | mistio/cloudify-common | 3b706ba31a3371052fbdd12486d4a0befbcf491b | [
"Apache-2.0"
] | 15 | 2018-10-13T20:36:42.000Z | 2021-09-06T15:19:11.000Z | from cloudify_rest_client.responses import ListResponse
class Workflow(dict):
def __init__(self, workflow):
super(Workflow, self).__init__()
self.update(workflow)
@property
def id(self):
return self['name']
@property
def name(self):
return self['name']
@prop... | 26.338983 | 77 | 0.594595 |
7ec1767616e07f25a9f4fcc840c2c8ca6c1b06bd | 22,984 | py | Python | salt/pillar/__init__.py | aletourneau/salt | d7013a2f64eb4b79592220d76274bc5dde609e08 | [
"Apache-2.0"
] | 1 | 2020-10-02T02:29:25.000Z | 2020-10-02T02:29:25.000Z | salt/pillar/__init__.py | aletourneau/salt | d7013a2f64eb4b79592220d76274bc5dde609e08 | [
"Apache-2.0"
] | null | null | null | salt/pillar/__init__.py | aletourneau/salt | d7013a2f64eb4b79592220d76274bc5dde609e08 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Render the pillar data
'''
# Import python libs
import os
import collections
import logging
from copy import copy
# Import salt libs
import salt.loader
import salt.fileclient
import salt.minion
import salt.crypt
import salt.transport
from salt._compat import string_types
from salt.template... | 37.927393 | 111 | 0.464976 |
fda20152febf7e9f69d3fd7c0f0e08be783c0fdc | 1,324 | py | Python | clinica/pipelines/t1_volume_parcellation/t1_volume_parcellation_utils.py | alexandreroutier/clinica | 66625c65e74962db7d5cea267d1a0e51d774bf91 | [
"MIT"
] | 1 | 2020-12-14T06:07:14.000Z | 2020-12-14T06:07:14.000Z | clinica/pipelines/t1_volume_parcellation/t1_volume_parcellation_utils.py | alexandreroutier/clinica | 66625c65e74962db7d5cea267d1a0e51d774bf91 | [
"MIT"
] | null | null | null | clinica/pipelines/t1_volume_parcellation/t1_volume_parcellation_utils.py | alexandreroutier/clinica | 66625c65e74962db7d5cea267d1a0e51d774bf91 | [
"MIT"
] | null | null | null | # coding: utf8
def atlas_statistics(in_image, atlas_list):
"""
For each atlas name provided it calculates for the input image the mean for each region in the atlas and saves it to a TSV file.
Args:
in_image: A Nifti image
atlas_list: List of names of atlas to be applied
Returns:
... | 37.828571 | 132 | 0.700151 |
f36605d5229679e139e8aebfb9a9ab10363b5041 | 1,844 | py | Python | src/genie/libs/parser/iosxe/tests/ShowPlatformSoftwareBpCrimsonContentConfig/cli/equal/golden_output_expected.py | ykoehler/genieparser | b62cf622c3d8eab77c7b69e932c214ed04a2565a | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/tests/ShowPlatformSoftwareBpCrimsonContentConfig/cli/equal/golden_output_expected.py | ykoehler/genieparser | b62cf622c3d8eab77c7b69e932c214ed04a2565a | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/tests/ShowPlatformSoftwareBpCrimsonContentConfig/cli/equal/golden_output_expected.py | ykoehler/genieparser | b62cf622c3d8eab77c7b69e932c214ed04a2565a | [
"Apache-2.0"
] | null | null | null | expected_output = {
'node': {
1: {
'priority': 1,
'domain': 1,
'mode': 'Aggregation',
'router_id': '0.0.0.0',
'configured_svl_links': {
'link_id': 1
},
'configured_svl_ports': {
'FourHundredGigE1/0/19': {
'link': ... | 27.522388 | 55 | 0.368221 |
3d981ab5ae2f7ffa2d1b8db8df6c5fce8768a7c2 | 10,103 | py | Python | opsdroid/connector/telegram/__init__.py | ceccs17d45/opsdroid | 0c7e0c0d34d242bf765639413fb8294e2e3fd232 | [
"Apache-2.0"
] | null | null | null | opsdroid/connector/telegram/__init__.py | ceccs17d45/opsdroid | 0c7e0c0d34d242bf765639413fb8294e2e3fd232 | [
"Apache-2.0"
] | null | null | null | opsdroid/connector/telegram/__init__.py | ceccs17d45/opsdroid | 0c7e0c0d34d242bf765639413fb8294e2e3fd232 | [
"Apache-2.0"
] | null | null | null | """A connector for Telegram."""
import asyncio
import logging
import aiohttp
from opsdroid.connector import Connector, register_event
from opsdroid.events import Message, Image
_LOGGER = logging.getLogger(__name__)
class ConnectorTelegram(Connector):
"""A connector the the char service Telegram."""
def __... | 33.902685 | 87 | 0.596456 |
f0789953fd7b7569117f720bd1f889de835c098d | 6,779 | py | Python | pychron/lasers/tasks/laser_actions.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 31 | 2016-03-07T02:38:17.000Z | 2022-02-14T18:23:43.000Z | pychron/lasers/tasks/laser_actions.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 1,626 | 2015-01-07T04:52:35.000Z | 2022-03-25T19:15:59.000Z | pychron/lasers/tasks/laser_actions.py | UIllinoisHALPychron/pychron | f21b79f4592a9fb9dc9a4cb2e4e943a3885ededc | [
"Apache-2.0"
] | 26 | 2015-05-23T00:10:06.000Z | 2022-03-07T16:51:57.000Z | # ===============================================================================
# Copyright 2013 Jake Ross
#
# 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/licens... | 28.970085 | 83 | 0.603186 |
eb84166e1c712596140d83d3510bf9bc8ae6e66c | 4,622 | py | Python | src/infi/mount_utils/linux/mount/repository.py | Infinidat/mount-utils | e4e08e21c278a2391494a7b9d9d7efdaeb393a9c | [
"BSD-3-Clause"
] | null | null | null | src/infi/mount_utils/linux/mount/repository.py | Infinidat/mount-utils | e4e08e21c278a2391494a7b9d9d7efdaeb393a9c | [
"BSD-3-Clause"
] | null | null | null | src/infi/mount_utils/linux/mount/repository.py | Infinidat/mount-utils | e4e08e21c278a2391494a7b9d9d7efdaeb393a9c | [
"BSD-3-Clause"
] | null | null | null | import platform
import re
from munch import Munch
from ...base.mount import MountRepositoryMixin
from logging import getLogger
from collections import OrderedDict
log = getLogger()
class LinuxMountRepositoryMixin(MountRepositoryMixin):
def _read_fstab(self):
return self._read_file("/etc/fstab")
def _... | 44.442308 | 118 | 0.596928 |
a6efd51e4eaa2fc711fc3ba4ee57c110d4942d6a | 1,448 | py | Python | src/day15.py | chipturner/advent-of-code-2021 | 52d8f84eb9243fa076c9f7c2a2e3836e138ab127 | [
"Apache-2.0"
] | null | null | null | src/day15.py | chipturner/advent-of-code-2021 | 52d8f84eb9243fa076c9f7c2a2e3836e138ab127 | [
"Apache-2.0"
] | null | null | null | src/day15.py | chipturner/advent-of-code-2021 | 52d8f84eb9243fa076c9f7c2a2e3836e138ab127 | [
"Apache-2.0"
] | null | null | null | import numpy
import helpers
import itertools
import collections
import heapq
bignum = 1000000000
def main() -> None:
g = helpers.read_input_digit_grid(int)
base_graph = helpers.read_input_digit_grid(int)
g = numpy.zeros((base_graph.shape[0] * 5, base_graph.shape[1] * 5), dtype=int)
numpy.set_printopti... | 28.96 | 154 | 0.55663 |
59564e5bb62e6b35c300c2182de43659ef531775 | 41,602 | py | Python | test/aaa_profiling/test_memusage.py | DylanModesitt/sqlalchemy | ce85681050500186678131f948b6ea277a65dc17 | [
"MIT"
] | 6 | 2019-02-18T12:42:44.000Z | 2020-11-11T23:10:17.000Z | test/aaa_profiling/test_memusage.py | 565407548/sqlalchemy | 53af60b3536221f2503af29c1e90cf9db1295faf | [
"MIT"
] | null | null | null | test/aaa_profiling/test_memusage.py | 565407548/sqlalchemy | 53af60b3536221f2503af29c1e90cf9db1295faf | [
"MIT"
] | 2 | 2016-11-02T04:59:02.000Z | 2019-05-11T06:01:30.000Z | import decimal
import gc
import itertools
import multiprocessing
import weakref
import sqlalchemy as sa
from sqlalchemy import ForeignKey
from sqlalchemy import inspect
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import test... | 25.952589 | 79 | 0.492861 |
61ea0c1ecc6acee4e0935e59d86cbbb22c5fd718 | 23,340 | py | Python | dask_ml/model_selection/_hyperband.py | thomasjpfan/dask-ml | b9d903ee2004178bcbe43a04493e23c2afdb7f60 | [
"BSD-3-Clause"
] | 1 | 2022-02-11T12:06:31.000Z | 2022-02-11T12:06:31.000Z | dask_ml/model_selection/_hyperband.py | thomasjpfan/dask-ml | b9d903ee2004178bcbe43a04493e23c2afdb7f60 | [
"BSD-3-Clause"
] | null | null | null | dask_ml/model_selection/_hyperband.py | thomasjpfan/dask-ml | b9d903ee2004178bcbe43a04493e23c2afdb7f60 | [
"BSD-3-Clause"
] | 3 | 2020-05-11T07:38:05.000Z | 2022-02-11T12:33:50.000Z | from __future__ import division
import logging
import math
from warnings import warn
import numpy as np
from sklearn.utils import check_random_state
from tornado import gen
from ._incremental import BaseIncrementalSearchCV
from ._successive_halving import SuccessiveHalvingSearchCV
logger = logging.getLogger(__name_... | 38.137255 | 102 | 0.613882 |
6a47e5128605d93cfd4b53993bf91f0f3ff3d723 | 3,167 | py | Python | autopsy_app/__init__.py | ep4sh/autopsy | 2bc7235657f94af5bad7975831e3709a363d125c | [
"MIT"
] | 1 | 2022-01-28T11:06:19.000Z | 2022-01-28T11:06:19.000Z | autopsy_app/__init__.py | ep4sh/autopsy | 2bc7235657f94af5bad7975831e3709a363d125c | [
"MIT"
] | 5 | 2021-04-28T10:53:07.000Z | 2022-02-06T01:08:09.000Z | autopsy_app/__init__.py | ep4sh/autopsy | 2bc7235657f94af5bad7975831e3709a363d125c | [
"MIT"
] | null | null | null | """
Create Autopsy Postmortem Web Application
Classes:
--- admin
AutopsyModelView(sqla.ModelView)
AutopsyAdminIndexView(admin.AdminIndexView)
--- form
RegistrationForm(FlaskForm)
LoginForm(FlaskForm)
ProfileForm(FlaskForm)
PostmortemForm(FlaskForm)
SupportForm(FlaskForm)
SearchF... | 32.316327 | 73 | 0.735712 |
e783eab59a815b7dbcaede013a4317d693a6ba8b | 1,142 | py | Python | simulation.py | 1orwell/yrs2013 | cc02ad037e9ee87be73519fe6be5c783e94d0ad8 | [
"MIT"
] | null | null | null | simulation.py | 1orwell/yrs2013 | cc02ad037e9ee87be73519fe6be5c783e94d0ad8 | [
"MIT"
] | 1 | 2017-07-15T11:31:06.000Z | 2017-07-15T12:34:10.000Z | simulation.py | 1orwell/yrs2013 | cc02ad037e9ee87be73519fe6be5c783e94d0ad8 | [
"MIT"
] | null | null | null |
from sets import Set
import pickle, random, os
from collections import defaultdict
import simclass
'''Virus spreading simulation using movement of people as given by fake.py
input format is
{id: {time : position}}
'''
#Options
#fin = './days/790-0.dat'
#fin = './groups/fake_groups.dat'
chance_of_infection = 1/36.0... | 23.791667 | 83 | 0.69352 |
c5f555eba2cbe5bb01b06af27285af58e4925234 | 1,111 | py | Python | model/calendar.py | Zonglin-Li6565/EInkUI | 13e6ac430e67d7e1e37deb550aa511e5d01150c6 | [
"MIT"
] | 224 | 2019-01-25T06:52:23.000Z | 2022-01-04T11:57:29.000Z | model/calendar.py | Zonglin-Li6565/EInkUI | 13e6ac430e67d7e1e37deb550aa511e5d01150c6 | [
"MIT"
] | 11 | 2019-04-02T06:23:23.000Z | 2021-12-29T04:26:53.000Z | model/calendar.py | Zonglin-Li6565/EInkUI | 13e6ac430e67d7e1e37deb550aa511e5d01150c6 | [
"MIT"
] | 24 | 2019-01-25T10:55:16.000Z | 2022-03-09T01:38:12.000Z | import calendar
import datetime
from typing import List, Tuple
def get_month_str() -> str:
return calendar.month_name[datetime.datetime.today().month]
def get_calendar_days() -> Tuple[List[int], Tuple[int, int]]:
"""
Get calendar grid of dates as well as starting week index and weekday index
"""
... | 28.487179 | 79 | 0.620162 |
49717ff05b0a8652e80d608424cb3c4dcf0fcc40 | 555 | py | Python | cv/cap.py | jt120/start-ml | 46a9ba31e4e9ce0d82cef0d28a15bd999c7b4147 | [
"Apache-2.0"
] | null | null | null | cv/cap.py | jt120/start-ml | 46a9ba31e4e9ce0d82cef0d28a15bd999c7b4147 | [
"Apache-2.0"
] | null | null | null | cv/cap.py | jt120/start-ml | 46a9ba31e4e9ce0d82cef0d28a15bd999c7b4147 | [
"Apache-2.0"
] | null | null | null | import cv2
cam = cv2.VideoCapture(0)
cv2.namedWindow("test")
img_counter = 0
while True:
ret, frame = cam.read()
cv2.imshow("test", frame)
if not ret:
break
k = cv2.waitKey(1)
if k%256 == 27:
# ESC pressed
print("Escape hit, closing...")
break
elif k%256 == 3... | 19.137931 | 60 | 0.581982 |
44a83220fa8c80b298f20969d4a982fbe2baa085 | 5,906 | py | Python | Predictor.py | dgirzadas/Pulse-of-the-City | d1bb113f18ab9f524211c612806d2c2908f0246f | [
"MIT"
] | 2 | 2020-07-20T10:11:36.000Z | 2020-07-20T10:13:11.000Z | Predictor.py | dgirzadas/Pulse-of-the-City | d1bb113f18ab9f524211c612806d2c2908f0246f | [
"MIT"
] | null | null | null | Predictor.py | dgirzadas/Pulse-of-the-City | d1bb113f18ab9f524211c612806d2c2908f0246f | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import datetime as dt
import pickle
import re
import Printer
def get_prediction_ids(dataframe):
"""
Gives the matrix of ids for columns that contain the predictions [<low_ids>, <mid_ids>, <high_ids>]
:param dataframe: prediction dataframe from the predict_timeframe f... | 41.591549 | 137 | 0.625974 |
fcb1114fab5efb365daa12d4ac4a845b55ea147b | 1,236 | py | Python | testing/functions/scipy_interpolation_linear.py | Navidhaddad/Interpolation-jeppesen | 4b408278ac7761169693483cea778b9425c60a80 | [
"MIT"
] | null | null | null | testing/functions/scipy_interpolation_linear.py | Navidhaddad/Interpolation-jeppesen | 4b408278ac7761169693483cea778b9425c60a80 | [
"MIT"
] | null | null | null | testing/functions/scipy_interpolation_linear.py | Navidhaddad/Interpolation-jeppesen | 4b408278ac7761169693483cea778b9425c60a80 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import json
from sklearn.model_selection import train_test_split
import scipy
def scipy_interpolation (data, interpolation_point):
y = data.FUELFLOW
X = data.drop(['FUELFLOW'], axis=1)
points , values = closest_points(X,y,interpolation_p... | 32.526316 | 120 | 0.572006 |
0e52f03da6c2c6479b7594e73e60ba6a5058b21f | 11,413 | py | Python | Schema/XProject.py | ndevenish/xia2 | 51eb0911457119f80803d5d061d44dc5f19b5a6e | [
"BSD-3-Clause"
] | null | null | null | Schema/XProject.py | ndevenish/xia2 | 51eb0911457119f80803d5d061d44dc5f19b5a6e | [
"BSD-3-Clause"
] | null | null | null | Schema/XProject.py | ndevenish/xia2 | 51eb0911457119f80803d5d061d44dc5f19b5a6e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# XProject.py
# Copyright (C) 2006 CCLRC, Graeme Winter
#
# This code is distributed under the BSD license, a copy of which is
# included in the root directory of this package.
#
# This represents the "top level" of the .xinfo hierarchy, and should
# exactly correspond to the contents of the... | 32.51567 | 84 | 0.613423 |
d14e202563b28e6ec0c470156441b3250d5e866b | 1,190 | py | Python | api.py | cqparts/cqparts_webapi | 67adc36f54dc5d486734133440a5b05908febcf8 | [
"Apache-2.0"
] | 3 | 2019-02-09T01:14:06.000Z | 2021-01-05T17:52:14.000Z | api.py | cqparts/cqparts_webapi | 67adc36f54dc5d486734133440a5b05908febcf8 | [
"Apache-2.0"
] | 4 | 2018-11-12T12:42:56.000Z | 2018-12-23T02:32:05.000Z | api.py | cqparts/cqparts_webapi | 67adc36f54dc5d486734133440a5b05908febcf8 | [
"Apache-2.0"
] | 1 | 2018-08-30T10:41:24.000Z | 2018-08-30T10:41:24.000Z | from flask import Blueprint, jsonify
bp = Blueprint("api", __name__, url_prefix="/api/v0/")
d = ""
@bp.route("/")
def index():
return "Index"
@bp.route("/list/<path:modelname>")
def subcat(modelname):
return jsonify(d.prefix(modelname))
@bp.route("/show/<path:modelname>")
def show(modelname):
return ... | 19.193548 | 54 | 0.547899 |
a2a1381eec723e20683a703b1584a92108852c39 | 5,073 | py | Python | infrastructure/storage/swift.py | Barometre-de-la-Science-Ouverte/bso3-harvest-publication | 06c729a1e44ed87e8f73b4c2bd456f5e09a73e34 | [
"MIT"
] | null | null | null | infrastructure/storage/swift.py | Barometre-de-la-Science-Ouverte/bso3-harvest-publication | 06c729a1e44ed87e8f73b4c2bd456f5e09a73e34 | [
"MIT"
] | null | null | null | infrastructure/storage/swift.py | Barometre-de-la-Science-Ouverte/bso3-harvest-publication | 06c729a1e44ed87e8f73b4c2bd456f5e09a73e34 | [
"MIT"
] | null | null | null | import shutil
from swiftclient.service import SwiftError, SwiftService, SwiftUploadObject
from typing import List
from config.harvester_config import config_harvester
from domain.ovh_path import OvhPath
from application.server.main.logger import get_logger
from config.logger_config import LOGGER_LEVEL
logger = get_lo... | 42.991525 | 145 | 0.58565 |
397caf9e474112b395f6110bc7de7d39c072ef05 | 466 | py | Python | scripts/buzzer3.py | gblackwell/pimouse_ros | b746a22ec0c4ccc7e7281b4283e1ef32ead0b264 | [
"BSD-3-Clause"
] | null | null | null | scripts/buzzer3.py | gblackwell/pimouse_ros | b746a22ec0c4ccc7e7281b4283e1ef32ead0b264 | [
"BSD-3-Clause"
] | null | null | null | scripts/buzzer3.py | gblackwell/pimouse_ros | b746a22ec0c4ccc7e7281b4283e1ef32ead0b264 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import rospy
from std_msgs.msg import UInt16
def write_freq(hz=0):
bfile = "/dev/rtbuzzer0"
try:
with open(bfile, "w") as f:
f.write(str(hz) + "\n")
except IOError:
rospy.logerr("can't write to " + bfile)
def recv_buzzer(data):
rospy.loginfo(data)
rospy.loginfo(data.data)... | 21.181818 | 49 | 0.675966 |
f5870be706c295f0bbacdd42842735fa72968f9b | 745 | py | Python | thingity/tests/test_palette.py | ianhomer/thingity | 7be534f0776799326acc0aae39d92813af61fb39 | [
"MIT"
] | null | null | null | thingity/tests/test_palette.py | ianhomer/thingity | 7be534f0776799326acc0aae39d92813af61fb39 | [
"MIT"
] | null | null | null | thingity/tests/test_palette.py | ianhomer/thingity | 7be534f0776799326acc0aae39d92813af61fb39 | [
"MIT"
] | null | null | null | import pytest
from pytest_bdd import scenarios, when, then, parsers
from .. import Palette
scenarios("features/palette.feature")
@pytest.fixture
def context():
return dict()
@when(parsers.parse("I have the empty palette"))
def I_have_empty_palette(context):
context["palette"] = Palette()
@when(parsers.pa... | 24.032258 | 55 | 0.722148 |
18ddbd72c4c351c4a46de79156da4b020baa11fe | 5,760 | py | Python | get_together/views/__init__.py | hmschreck/GetTogether | acc645d065121cf34418dd70ebb96da3588f5acb | [
"BSD-2-Clause"
] | null | null | null | get_together/views/__init__.py | hmschreck/GetTogether | acc645d065121cf34418dd70ebb96da3588f5acb | [
"BSD-2-Clause"
] | null | null | null | get_together/views/__init__.py | hmschreck/GetTogether | acc645d065121cf34418dd70ebb96da3588f5acb | [
"BSD-2-Clause"
] | null | null | null | from django.utils.translation import ugettext_lazy as _
from django.contrib import messages
from django.contrib.auth import logout as logout_user
from django.shortcuts import render, redirect
from django.http import HttpResponse, JsonResponse
from events.models.locale import City
from events.models.events import Even... | 43.308271 | 180 | 0.642882 |
000b21e18d29d5cacd2745d07a38da9ebb3ae50f | 5,645 | py | Python | graphene_django/rest_framework/mutation.py | bellini666/graphene-django | 558288afcefe49c0183e0ab16bb2c6ead4d8041d | [
"MIT"
] | 4,038 | 2016-09-18T01:45:22.000Z | 2022-03-31T01:06:57.000Z | graphene_django/rest_framework/mutation.py | bellini666/graphene-django | 558288afcefe49c0183e0ab16bb2c6ead4d8041d | [
"MIT"
] | 1,104 | 2016-09-19T20:10:22.000Z | 2022-03-30T17:37:46.000Z | graphene_django/rest_framework/mutation.py | bellini666/graphene-django | 558288afcefe49c0183e0ab16bb2c6ead4d8041d | [
"MIT"
] | 791 | 2016-09-18T13:48:11.000Z | 2022-03-29T08:32:06.000Z | from collections import OrderedDict
from django.shortcuts import get_object_or_404
from rest_framework import serializers
import graphene
from graphene.relay.mutation import ClientIDMutation
from graphene.types import Field, InputField
from graphene.types.mutation import MutationOptions
from graphene.types.objecttype... | 32.073864 | 86 | 0.619663 |
8388a3d202fffb061be2a50096c4a6d6082112be | 617 | py | Python | score-sets/GRCh37/RVIS/make.py | jimhavrilla/pathoscore | 4d0c2ada1c534bd672e106d253d089745e2f2417 | [
"MIT"
] | 24 | 2017-08-25T17:27:24.000Z | 2021-12-24T18:05:02.000Z | score-sets/GRCh37/RVIS/make.py | jimhavrilla/pathoscore | 4d0c2ada1c534bd672e106d253d089745e2f2417 | [
"MIT"
] | 36 | 2017-08-25T17:32:45.000Z | 2019-10-22T21:32:05.000Z | score-sets/GRCh37/RVIS/make.py | jimhavrilla/pathoscore | 4d0c2ada1c534bd672e106d253d089745e2f2417 | [
"MIT"
] | 9 | 2017-08-25T21:38:43.000Z | 2021-12-24T18:05:03.000Z | import sys
import toolshed as ts
from collections import defaultdict
genes = defaultdict(float)
for d in ts.reader(sys.argv[1]):
genes[d['CCDSr20']] = float(d['%RVIS[pop_maf_0.05%(any)]']) # gene, value at 0.05% MAF
for line in open(sys.argv[2], "r"): # gene list
fields = line.strip().split("\t")
chrom = ... | 38.5625 | 90 | 0.641815 |
4d18a820f60927f68cd5581ab1aa3c607744ddfc | 6,997 | py | Python | svdbs/tests/factories.py | brand-fabian/varfish-server | 6a084d891d676ff29355e72a29d4f7b207220283 | [
"MIT"
] | 14 | 2019-09-30T12:44:17.000Z | 2022-02-04T14:45:16.000Z | svdbs/tests/factories.py | brand-fabian/varfish-server | 6a084d891d676ff29355e72a29d4f7b207220283 | [
"MIT"
] | 244 | 2021-03-26T15:13:15.000Z | 2022-03-31T15:48:04.000Z | svdbs/tests/factories.py | brand-fabian/varfish-server | 6a084d891d676ff29355e72a29d4f7b207220283 | [
"MIT"
] | 8 | 2020-05-19T21:55:13.000Z | 2022-03-31T07:02:58.000Z | """Factory Boy factory classes for ``svdbs``."""
import binning
import factory
from ..models import (
DgvGoldStandardSvs,
DgvSvs,
ExacCnv,
ThousandGenomesSv,
DbVarSv,
GnomAdSv,
EXAC_POP_CHOICES,
)
class DgvGoldStandardSvsFactory(factory.django.DjangoModelFactory):
class Meta:
... | 27.439216 | 97 | 0.624125 |
186a3f1c7692173c034ff51a1ee3eec118aa4d7f | 776 | py | Python | debian/python-nova/usr/lib/python2.7/dist-packages/nova/tests/compute/__init__.py | bopopescu/stacklab-nova | 4ab1698659b663ef222255610d1a5c042706dd65 | [
"Apache-2.0"
] | null | null | null | debian/python-nova/usr/lib/python2.7/dist-packages/nova/tests/compute/__init__.py | bopopescu/stacklab-nova | 4ab1698659b663ef222255610d1a5c042706dd65 | [
"Apache-2.0"
] | null | null | null | debian/python-nova/usr/lib/python2.7/dist-packages/nova/tests/compute/__init__.py | bopopescu/stacklab-nova | 4ab1698659b663ef222255610d1a5c042706dd65 | [
"Apache-2.0"
] | 1 | 2020-07-24T08:31:57.000Z | 2020-07-24T08:31:57.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | 38.8 | 78 | 0.731959 |
f3f332f1ff4e8eed822a742cea8350ea68c4608b | 4,228 | py | Python | python/ray/tune/suggest/__init__.py | carlos-aguayo/ray | fedbdd5dc6a47aa9cba170816f8c0950193b4fd6 | [
"Apache-2.0"
] | 1 | 2020-11-09T04:14:58.000Z | 2020-11-09T04:14:58.000Z | python/ray/tune/suggest/__init__.py | carlos-aguayo/ray | fedbdd5dc6a47aa9cba170816f8c0950193b4fd6 | [
"Apache-2.0"
] | null | null | null | python/ray/tune/suggest/__init__.py | carlos-aguayo/ray | fedbdd5dc6a47aa9cba170816f8c0950193b4fd6 | [
"Apache-2.0"
] | null | null | null | from ray.tune.suggest.search import SearchAlgorithm
from ray.tune.suggest.basic_variant import BasicVariantGenerator
from ray.tune.suggest.suggestion import Searcher, ConcurrencyLimiter
from ray.tune.suggest.search_generator import SearchGenerator
from ray.tune.suggest.variant_generator import grid_search
from ray.tune... | 33.824 | 78 | 0.701514 |
fe18acf4bfb2e7d9d46def6c72b8063a583711a9 | 566 | py | Python | PP4E-Examples-1.4/Examples/PP4E/Gui/Tour/dialogTable.py | AngelLiang/PP4E | 3a7f63b366e1e4700b4d2524884696999a87ba9d | [
"MIT"
] | null | null | null | PP4E-Examples-1.4/Examples/PP4E/Gui/Tour/dialogTable.py | AngelLiang/PP4E | 3a7f63b366e1e4700b4d2524884696999a87ba9d | [
"MIT"
] | null | null | null | PP4E-Examples-1.4/Examples/PP4E/Gui/Tour/dialogTable.py | AngelLiang/PP4E | 3a7f63b366e1e4700b4d2524884696999a87ba9d | [
"MIT"
] | null | null | null | # define a name:callback demos table
from tkinter.filedialog import askopenfilename # get standard dialogs
from tkinter.colorchooser import askcolor # they live in Lib\tkinter
from tkinter.messagebox import askquestion, showerror
from tkinter.simpledialog import askfloat
demos = {
'Open':... | 37.733333 | 82 | 0.696113 |
9c35c1f545132156bdda89331f7ca11282215e16 | 6,543 | py | Python | secretScript_german.py | grapealope/secrets | c26b99824d004c26e76c5672d293abd48cc1052e | [
"MIT"
] | 1 | 2018-02-22T03:42:45.000Z | 2018-02-22T03:42:45.000Z | secretScript_german.py | grapealope/secrets | c26b99824d004c26e76c5672d293abd48cc1052e | [
"MIT"
] | null | null | null | secretScript_german.py | grapealope/secrets | c26b99824d004c26e76c5672d293abd48cc1052e | [
"MIT"
] | null | null | null | import os, sys
import json
import csv
import collections
import random
from pprint import pprint
from playsound import playsound
import datetime
from six import string_types
from boto3 import Session
from botocore.exceptions import BotoCoreError, ClientError
from contextlib import closing
from pollySpeak import newSess... | 33.726804 | 157 | 0.725355 |
703410bf2adaf81ca8ad0c6fcb70457aaa8c5793 | 1,254 | py | Python | src/bobbit/modules/suggest.py | camicarballo/camelot-bobbit | d0fbb1e2080ff533b0f5ae5194cc5d5b934b6b5f | [
"MIT"
] | null | null | null | src/bobbit/modules/suggest.py | camicarballo/camelot-bobbit | d0fbb1e2080ff533b0f5ae5194cc5d5b934b6b5f | [
"MIT"
] | null | null | null | src/bobbit/modules/suggest.py | camicarballo/camelot-bobbit | d0fbb1e2080ff533b0f5ae5194cc5d5b934b6b5f | [
"MIT"
] | null | null | null | # suggest.py
import logging
# Metadata
NAME = 'suggest'
ENABLE = True
PATTERN = r'^!suggest (?P<target>[-\w#]*) (?P<suggestion>.*)'
USAGE = '''Usage: !suggest <channel> <message>
This anonymously sends a message to the specified channel.
Example:
> !suggest #cse-40175-fa18 what about bob?
'''
# Constants
... | 23.222222 | 77 | 0.649123 |
d79b7743a7d529fdd79614f79ef096611a92c468 | 20,864 | py | Python | Cython/Build/IpythonMagic.py | aiudirog/cython | 37a13a5563a1108dca15ffc45e2b614bbf7db94f | [
"Apache-2.0"
] | 1 | 2019-06-05T00:10:34.000Z | 2019-06-05T00:10:34.000Z | Cython/Build/IpythonMagic.py | aiudirog/cython | 37a13a5563a1108dca15ffc45e2b614bbf7db94f | [
"Apache-2.0"
] | null | null | null | Cython/Build/IpythonMagic.py | aiudirog/cython | 37a13a5563a1108dca15ffc45e2b614bbf7db94f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
=====================
Cython related magics
=====================
Magic command interface for interactive work with Cython
.. note::
The ``Cython`` package needs to be installed separately. It
can be obtained using ``easy_install`` or ``pip``.
Usage
=====
To enable the magics below,... | 38.072993 | 114 | 0.610142 |
2db0dad9890943fdf0ae8704d6ddb293ad11ce7e | 1,200 | py | Python | rps.py | bovinezro/rock-paper-scissors | 9ae17827e243a6b5e2f383ad20e76988b11bbbd8 | [
"Unlicense"
] | null | null | null | rps.py | bovinezro/rock-paper-scissors | 9ae17827e243a6b5e2f383ad20e76988b11bbbd8 | [
"Unlicense"
] | null | null | null | rps.py | bovinezro/rock-paper-scissors | 9ae17827e243a6b5e2f383ad20e76988b11bbbd8 | [
"Unlicense"
] | null | null | null | from random import *
replay = "y"
picks = ["rock", "paper", "scissors"]
tally = [0,0]
while replay.lower() == "y":
cpu = randint(0,2)
user = "a"
while (user.lower() != "rock" and
user.lower() != "paper" and
user.lower() != "scissors" and
user.lower() != "r" and
user.lower() != "p" and
... | 29.268293 | 66 | 0.504167 |
99639dd2c2d3006222ab036ba3f6caf99450b3dc | 2,841 | py | Python | bluezero/central.py | ubiquiti/python-bluezero-REMOVE | 3c60ed33075488343c2ef968d2a965420410125f | [
"MIT"
] | 1 | 2020-02-27T07:23:57.000Z | 2020-02-27T07:23:57.000Z | bluezero/central.py | ubiquiti/python-bluezero-REMOVE | 3c60ed33075488343c2ef968d2a965420410125f | [
"MIT"
] | null | null | null | bluezero/central.py | ubiquiti/python-bluezero-REMOVE | 3c60ed33075488343c2ef968d2a965420410125f | [
"MIT"
] | null | null | null | """Classes that represent the GATT features of a remote device."""
from time import sleep
import logging
try: # Python 2.7+
from logging import NullHandler
except ImportError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
from bluezero import adapter
from bluezero impo... | 29.905263 | 74 | 0.617388 |
567b8a95867aa6056c2679669595d2b9aaf14398 | 181 | py | Python | examples/elixir_rockstar.py | johniek/meteor-rock | 8a6eb3d0966f9a4717293d1d7ee9954aa340c304 | [
"MIT"
] | 1 | 2021-07-31T23:33:42.000Z | 2021-07-31T23:33:42.000Z | examples/elixir_rockstar.py | gombirot/rockstar | 3b8956bbe931a0ac12b6c435f490af524e59bcc4 | [
"MIT"
] | 1 | 2015-07-22T12:26:06.000Z | 2015-07-22T12:26:06.000Z | examples/elixir_rockstar.py | johniek/meteor-rock | 8a6eb3d0966f9a4717293d1d7ee9954aa340c304 | [
"MIT"
] | null | null | null | from RockStar import RockStar
elixir_code = 'IO.puts "Hello world"'
rock_it_bro = RockStar(days=400, file_name='helloWorld.exs', code=elixir_code)
rock_it_bro.make_me_a_rockstar()
| 30.166667 | 78 | 0.801105 |
724ec38204fbc4b181dd3911dbfe768f0af16b07 | 1,541 | py | Python | examples/bio_based/run_test_BBO.py | ashishpatel26/mealpy | 62160e61b8bd4b084e44b80fda720e6bd6332e03 | [
"MIT"
] | 1 | 2021-05-20T06:53:08.000Z | 2021-05-20T06:53:08.000Z | examples/bio_based/run_test_BBO.py | chenyuxiang0425/mealpy | 69e8dc727e15527e31ac5ace1debe92a0bc7d828 | [
"MIT"
] | null | null | null | examples/bio_based/run_test_BBO.py | chenyuxiang0425/mealpy | 69e8dc727e15527e31ac5ace1debe92a0bc7d828 | [
"MIT"
] | 1 | 2020-09-30T21:14:33.000Z | 2020-09-30T21:14:33.000Z | #!/usr/bin/env python
# ------------------------------------------------------------------------------------------------------%
# Created by "Thieu Nguyen" at 03:39, 07/06/2020 %
# ... | 42.805556 | 105 | 0.452953 |
ab3ea302cb1b54bcb11cc17abdfcafe16e7a3056 | 5,153 | py | Python | textattack/commands/attack/run_attack_single_threaded.py | chong-z/TextAttack | 9842160b558db2118365770029be70782327a40a | [
"MIT"
] | null | null | null | textattack/commands/attack/run_attack_single_threaded.py | chong-z/TextAttack | 9842160b558db2118365770029be70782327a40a | [
"MIT"
] | null | null | null | textattack/commands/attack/run_attack_single_threaded.py | chong-z/TextAttack | 9842160b558db2118365770029be70782327a40a | [
"MIT"
] | null | null | null | """A command line parser to run an attack from user specifications."""
from collections import deque, OrderedDict
import os
import time
import tqdm
import textattack
from .attack_args_helpers import (
parse_attack_from_args,
parse_dataset_from_args,
parse_logger_from_args,
parse_model_from_args,
)
l... | 33.679739 | 93 | 0.603532 |
15099ddea1a4040796b9932bd97468d5315cea40 | 11,716 | py | Python | mpi_array/globale_creation_test.py | mpi-array/mpi_array | 6a6c707300f7c65d6be5e7e3ef196d7abea10a06 | [
"MIT"
] | 2 | 2018-06-05T14:05:09.000Z | 2021-05-08T14:16:33.000Z | mpi_array/globale_creation_test.py | mpi-array/mpi_array | 6a6c707300f7c65d6be5e7e3ef196d7abea10a06 | [
"MIT"
] | null | null | null | mpi_array/globale_creation_test.py | mpi-array/mpi_array | 6a6c707300f7c65d6be5e7e3ef196d7abea10a06 | [
"MIT"
] | 3 | 2018-01-01T17:52:31.000Z | 2021-06-08T15:48:29.000Z | """
=================================================
The :mod:`mpi_array.globale_creation_test` Module
=================================================
Module for testing creation/factory functions which
generate instances of :mod:`mpi_array.globale.gndarray`.
Execute as::
python -m mpi_array.globale_creation_te... | 34.662722 | 94 | 0.641174 |
e5d0c271e224a7ae943346712961b53fcc28e213 | 64,071 | py | Python | src/transformers/modeling_lxmert.py | katarinaslama/transformers-1 | a5a8eeb772b185b0746f3ce9be6ae43181d2ca71 | [
"Apache-2.0"
] | 4 | 2021-01-15T20:20:47.000Z | 2021-11-14T18:33:42.000Z | src/transformers/modeling_lxmert.py | yym6472/transformers | abd01205561e5caec167c1fbb20bccea24d7ba46 | [
"Apache-2.0"
] | 1 | 2021-09-15T09:20:01.000Z | 2022-03-02T17:16:01.000Z | src/transformers/modeling_lxmert.py | yym6472/transformers | abd01205561e5caec167c1fbb20bccea24d7ba46 | [
"Apache-2.0"
] | 1 | 2020-11-11T14:29:22.000Z | 2020-11-11T14:29:22.000Z | # coding=utf-8
# Copyright 2018 Hao Tan, Mohit Bansal, and the HuggingFace team
#
# 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 r... | 44.52467 | 177 | 0.672114 |
4f7ce3d87ad08d4e15272441352031b84b18bdd9 | 10,688 | py | Python | depfixer.py | tp-m/meson | 2d1aa395e86848ca948d30d83cc5357777e5b490 | [
"Apache-2.0"
] | null | null | null | depfixer.py | tp-m/meson | 2d1aa395e86848ca948d30d83cc5357777e5b490 | [
"Apache-2.0"
] | null | null | null | depfixer.py | tp-m/meson | 2d1aa395e86848ca948d30d83cc5357777e5b490 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2013-2014 The Meson development team
# 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... | 35.626667 | 88 | 0.573915 |
b9f29201bc74a094ba9b7b47f9c64b07c1faf29a | 8,110 | py | Python | srctools/compiler/mdl_compiler.py | Smaedd/srctools | 7d2660aca84b3f8b70bc00478216b608d47c719b | [
"MIT"
] | null | null | null | srctools/compiler/mdl_compiler.py | Smaedd/srctools | 7d2660aca84b3f8b70bc00478216b608d47c719b | [
"MIT"
] | null | null | null | srctools/compiler/mdl_compiler.py | Smaedd/srctools | 7d2660aca84b3f8b70bc00478216b608d47c719b | [
"MIT"
] | null | null | null | """Manages potential models that are being generated.
Each comes with a key, used to identify a previously compiled version.
We can then reuse already compiled versions.
"""
import os
import pickle
import subprocess
import tempfile
import random
from typing import (
Optional, TypeVar,
Dict, Set, List, Hashable... | 35.414847 | 99 | 0.561406 |
66470e1dc1f32b46928ce51f7ac985da455f90c3 | 3,767 | py | Python | contrib/macdeploy/custom_dsstore.py | dongri-project/dongri | 2fd8d8d0ef039b0bd814edebb00c92b7f25f06b3 | [
"MIT"
] | 10 | 2018-05-15T16:13:44.000Z | 2018-05-15T16:18:20.000Z | contrib/macdeploy/custom_dsstore.py | dongri-project/dongri | 2fd8d8d0ef039b0bd814edebb00c92b7f25f06b3 | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | dongri-project/dongri | 2fd8d8d0ef039b0bd814edebb00c92b7f25f06b3 | [
"MIT"
] | 2 | 2018-05-22T11:52:52.000Z | 2018-06-15T06:10:35.000Z | #!/usr/bin/env python
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from __future__ import division,print_function,unicode_literals
import biplist
from ds_store import DSStore... | 61.754098 | 1,817 | 0.726838 |
4268565fc82d9c5147f6a073d4275b9463171553 | 2,861 | py | Python | synapse/replication/slave/storage/account_data.py | littlebenlittle/synapse | 0eccf531466d762ede0dd365284a8465bfb18d0f | [
"Apache-2.0"
] | 1 | 2021-04-27T19:04:56.000Z | 2021-04-27T19:04:56.000Z | synapse/replication/slave/storage/account_data.py | littlebenlittle/synapse | 0eccf531466d762ede0dd365284a8465bfb18d0f | [
"Apache-2.0"
] | null | null | null | synapse/replication/slave/storage/account_data.py | littlebenlittle/synapse | 0eccf531466d762ede0dd365284a8465bfb18d0f | [
"Apache-2.0"
] | 1 | 2020-09-23T12:36:11.000Z | 2020-09-23T12:36:11.000Z | # -*- coding: utf-8 -*-
# Copyright 2016 OpenMarket Ltd
# Copyright 2018 New Vector Ltd
#
# 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
#
# ... | 46.145161 | 88 | 0.698707 |
d0c1a54ca84d8b1f9df8eb57a2a95449e268b71a | 4,098 | py | Python | pikudhaoref/abc.py | adam757521/PikudHaoref.py | 49e2bfcc67478ad80f681d8ad1e358d54466a384 | [
"MIT"
] | null | null | null | pikudhaoref/abc.py | adam757521/PikudHaoref.py | 49e2bfcc67478ad80f681d8ad1e358d54466a384 | [
"MIT"
] | null | null | null | pikudhaoref/abc.py | adam757521/PikudHaoref.py | 49e2bfcc67478ad80f681d8ad1e358d54466a384 | [
"MIT"
] | null | null | null | from __future__ import annotations
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Any, List, Dict
import json
from .city import City
from .base import EventManager
from .exceptions import AccessDenied
if TYPE_CHECKING:
from datetime import datetime
__all__ = ("HTTPClient", "Client")
cla... | 23.825581 | 89 | 0.57101 |
e202eb75e6b2e39c95ce5f940c5dcc089a7f1a52 | 1,339 | py | Python | app/core/tests/test_admin.py | oscarmunoz1/recipe-app-api | 19f524d34522a9a1950658d294c1b3a324e43138 | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | oscarmunoz1/recipe-app-api | 19f524d34522a9a1950658d294c1b3a324e43138 | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | oscarmunoz1/recipe-app-api | 19f524d34522a9a1950658d294c1b3a324e43138 | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='admin@omunoz.com',
... | 30.431818 | 68 | 0.636296 |
6c58c7ccf2cc01b1ccd2b2828566e6c4fb67de8b | 7,354 | py | Python | python/paddle/fluid/tests/unittests/xpu/test_clip_op_xpu.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 4 | 2021-02-08T13:07:15.000Z | 2021-10-22T00:58:33.000Z | python/paddle/fluid/tests/unittests/xpu/test_clip_op_xpu.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 2 | 2019-07-26T04:06:05.000Z | 2019-07-29T04:25:24.000Z | python/paddle/fluid/tests/unittests/xpu/test_clip_op_xpu.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 5 | 2021-12-10T11:20:06.000Z | 2022-02-18T05:18:12.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 33.889401 | 76 | 0.612184 |
7b0b068adfdd3043d8e7d645c3a817e898614f6c | 1,099 | py | Python | virtual/lib/python3.6/site-packages/pylint/test/functional/too_many_branches.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 463 | 2015-01-15T08:17:42.000Z | 2022-03-28T15:10:20.000Z | virtual/lib/python3.6/site-packages/pylint/test/functional/too_many_branches.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 52 | 2015-01-06T02:43:59.000Z | 2022-03-14T11:15:21.000Z | virtual/lib/python3.6/site-packages/pylint/test/functional/too_many_branches.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 249 | 2015-01-07T22:49:49.000Z | 2022-03-18T02:32:06.000Z | """ Test for too many branches. """
# pylint: disable=using-constant-test
def wrong(): # [too-many-branches]
""" Has too many branches. """
if 1:
pass
elif 1:
pass
elif 1:
pass
elif 1:
pass
elif 1:
pass
elif 1:
pass
try:
... | 15.7 | 45 | 0.393085 |
7dc998a498c495e3cc17e7d9c6d543d0488ef61c | 92 | py | Python | src/easy_automation/utils/__init__.py | zhangjiapeng23/easy_automation_test | ad4c72572cb62bcca009aa06ea91ec4343b12def | [
"MIT"
] | null | null | null | src/easy_automation/utils/__init__.py | zhangjiapeng23/easy_automation_test | ad4c72572cb62bcca009aa06ea91ec4343b12def | [
"MIT"
] | null | null | null | src/easy_automation/utils/__init__.py | zhangjiapeng23/easy_automation_test | ad4c72572cb62bcca009aa06ea91ec4343b12def | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# @author: James Zhang
# @data : 2021/7/20
| 18.4 | 25 | 0.586957 |
0c519e21f35f64078b5d58dcc57a34a77871a069 | 3,074 | py | Python | tfx/components/experimental/data_view/provider_executor_test.py | yifanmai/tfx | 56b4d373b8b777a780f4552b5834925e837c51e9 | [
"Apache-2.0"
] | 3 | 2020-07-20T18:37:16.000Z | 2021-11-17T11:24:27.000Z | tfx/components/experimental/data_view/provider_executor_test.py | yifanmai/tfx | 56b4d373b8b777a780f4552b5834925e837c51e9 | [
"Apache-2.0"
] | 2 | 2020-08-11T00:19:14.000Z | 2020-08-26T20:10:31.000Z | tfx/components/experimental/data_view/provider_executor_test.py | yifanmai/tfx | 56b4d373b8b777a780f4552b5834925e837c51e9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 39.922078 | 80 | 0.727716 |
26f0603e6f4eab17e0c1abe88e2285905a67f3b0 | 34,450 | py | Python | test/run_tests.py | etiennekintzler/vowpal_wabb | 6b45001e89ed9b732fee0288d046c155f1c69e6d | [
"BSD-3-Clause"
] | 2 | 2021-06-03T22:30:52.000Z | 2021-07-18T15:45:44.000Z | test/run_tests.py | etiennekintzler/vowpal_wabb | 6b45001e89ed9b732fee0288d046c155f1c69e6d | [
"BSD-3-Clause"
] | null | null | null | test/run_tests.py | etiennekintzler/vowpal_wabb | 6b45001e89ed9b732fee0288d046c155f1c69e6d | [
"BSD-3-Clause"
] | 1 | 2021-07-18T15:45:51.000Z | 2021-07-18T15:45:51.000Z | import shutil
import threading
import argparse
import difflib
from pathlib import Path
import re
import os
import os.path
import subprocess
import sys
import traceback
import json
from concurrent.futures import ThreadPoolExecutor
from enum import Enum
import socket
import runtests_parser
import runtests_flatbuffer_co... | 39.7806 | 168 | 0.608331 |
7522bef6950b9c81a129690880bc9f90330c9775 | 18 | py | Python | tests/__init__.py | Parquery/mapry | 93515307f9eba8447fe64b0ac7cc68b2d07205a7 | [
"MIT"
] | 11 | 2019-06-26T05:56:41.000Z | 2021-03-28T16:44:16.000Z | tests/__init__.py | Parquery/mapry | 93515307f9eba8447fe64b0ac7cc68b2d07205a7 | [
"MIT"
] | 4 | 2019-10-18T14:43:59.000Z | 2020-04-02T19:12:07.000Z | tests/__init__.py | Parquery/mapry | 93515307f9eba8447fe64b0ac7cc68b2d07205a7 | [
"MIT"
] | 3 | 2019-06-17T07:39:03.000Z | 2020-04-01T14:01:23.000Z | """Test mapry."""
| 9 | 17 | 0.5 |
4fad0dae968a9706ea5623c8122e008bfe03a283 | 259 | py | Python | maro/cli/k8s/template.py | KangFengjian/maro | 2694a75731d5174ba5b33780670ba38d776d8c5a | [
"MIT"
] | 1 | 2020-09-30T09:31:05.000Z | 2020-09-30T09:31:05.000Z | maro/cli/k8s/template.py | KangFengjian/maro | 2694a75731d5174ba5b33780670ba38d776d8c5a | [
"MIT"
] | 2 | 2020-12-15T09:13:43.000Z | 2020-12-16T08:02:41.000Z | maro/cli/k8s/template.py | KangFengjian/maro | 2694a75731d5174ba5b33780670ba38d776d8c5a | [
"MIT"
] | 1 | 2021-10-01T09:17:43.000Z | 2021-10-01T09:17:43.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from maro.cli.k8s.executors.k8s_azure_executor import K8sAzureExecutor
def template(export_path: str, **kwargs):
K8sAzureExecutor.template(
export_path=export_path
)
| 21.583333 | 70 | 0.756757 |
140754bde0eab1ea0d1dc81567f06ea6f7a7d43b | 12,479 | py | Python | tests/test_unique_queues.py | ondrejkajinek/py-rq | 0fb89b5cb23f3410057e23b85fa9deb5ddebd275 | [
"MIT"
] | 2 | 2017-01-10T06:32:40.000Z | 2018-11-17T05:42:54.000Z | tests/test_unique_queues.py | ondrejkajinek/py-rq | 0fb89b5cb23f3410057e23b85fa9deb5ddebd275 | [
"MIT"
] | 3 | 2016-05-13T09:02:16.000Z | 2021-05-07T10:34:21.000Z | tests/test_unique_queues.py | ondrejkajinek/py-rq | 0fb89b5cb23f3410057e23b85fa9deb5ddebd275 | [
"MIT"
] | 3 | 2017-09-13T15:17:44.000Z | 2021-05-07T07:02:44.000Z | import unittest
import time
import socket
import os
from unittest.mock import patch
from redis import Redis
from pyrq.unique_queues import UniqueQueue, CHUNK_SIZE
QUEUE_NAME = os.getenv('QUEUE_NAME', 'test-queue')
PROCESSING_QUEUE_SCHEMA = QUEUE_NAME + '-processing-{}[{}][{}]'
TIMEOUT_QUEUE = QUEUE_NAME + '-timeouts'... | 46.218519 | 109 | 0.675134 |
530affd163d5fc899995e9d151d8956b5bebfb25 | 2,065 | py | Python | zql-backend/grammar_persistence/graph.py | Zubdano/zql | 2e1ec981da60cfd41ad743bc38950c97e506c2c8 | [
"MIT"
] | null | null | null | zql-backend/grammar_persistence/graph.py | Zubdano/zql | 2e1ec981da60cfd41ad743bc38950c97e506c2c8 | [
"MIT"
] | 4 | 2017-09-25T04:35:01.000Z | 2017-12-18T04:15:04.000Z | zql-backend/grammar_persistence/graph.py | Zubdano/zql | 2e1ec981da60cfd41ad743bc38950c97e506c2c8 | [
"MIT"
] | null | null | null | def construct_graph(grammar):
"""Constructs a graph representation of the input grammar.
The graph contains only the LHS rules, and doesn't containt any free variables.
Returns in an adjacency list format.
"""
graph = {}
rules = filter(lambda lhs: grammar[lhs]['type'] == 'rule', grammar.key... | 23.465909 | 83 | 0.602906 |
342f191d50a47288d145ba3b82b0d89455fcf4a4 | 317 | py | Python | Languages/Python3/Practise/0004/0004.py | PaddyHuang/Basic | b304a8b7a24e216486293182fe86325e6a7746ff | [
"MIT"
] | null | null | null | Languages/Python3/Practise/0004/0004.py | PaddyHuang/Basic | b304a8b7a24e216486293182fe86325e6a7746ff | [
"MIT"
] | null | null | null | Languages/Python3/Practise/0004/0004.py | PaddyHuang/Basic | b304a8b7a24e216486293182fe86325e6a7746ff | [
"MIT"
] | null | null | null | #!/usr/local/bin/python3
# Description: 任一个英文的纯文本文件,统计其中的单词出现的个数。
# Author: Paddy Huang
# Date: 2020-03-28 22:35
import re
def func(file_path):
file = open(file_path, 'r').read()
file = re.findall(r'[\w\-\_\'\.]+', file)
print(len(file))
if __name__ == '__main__':
file_path = 'English.txt'
func(file_path)
| 17.611111 | 42 | 0.66877 |
58392a7a0d3ceb90fa9b59bde18d6b6d31257982 | 4,028 | py | Python | processing/dbmanageragent.py | paganellif/sctm-project-paganelli-2021 | 810d9a82c653db8ec9db117c57f35b64cc14aaaf | [
"MIT"
] | null | null | null | processing/dbmanageragent.py | paganellif/sctm-project-paganelli-2021 | 810d9a82c653db8ec9db117c57f35b64cc14aaaf | [
"MIT"
] | null | null | null | processing/dbmanageragent.py | paganellif/sctm-project-paganelli-2021 | 810d9a82c653db8ec9db117c57f35b64cc14aaaf | [
"MIT"
] | null | null | null | import json
from spade.agent import Agent
from spade.behaviour import State
from spade.message import Message
from spade.template import Template
from processing.dbmanagerstrategy import DBManagerStrategy
from base.fsm import BaseFSM
from processing.dbconnfactory import DBConnFactory
import util.config as cfg
from util... | 40.686869 | 109 | 0.623883 |
69f19c069a82094ff2aa84fb190b86fd553e913c | 1,885 | py | Python | pyQBTNs/src/Tensor_Train_Recursive.py | MaksimEkin/pyQBTNs | fab4db14c0b7c883f51efa4a79d8f9b3b6a6d6f8 | [
"BSD-3-Clause"
] | null | null | null | pyQBTNs/src/Tensor_Train_Recursive.py | MaksimEkin/pyQBTNs | fab4db14c0b7c883f51efa4a79d8f9b3b6a6d6f8 | [
"BSD-3-Clause"
] | null | null | null | pyQBTNs/src/Tensor_Train_Recursive.py | MaksimEkin/pyQBTNs | fab4db14c0b7c883f51efa4a79d8f9b3b6a6d6f8 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import math
from .Matrix_Factorization import Matrix_Factorization
from .tensor_utils import split_TT
class Tensor_Train_Recursive():
def __init__(self, **parameters):
"""
Parameters
----------
**parameters : dictionary
Passed from pyQBTNs from ini... | 29.453125 | 106 | 0.561804 |
1a4315fc54e284bc8aff3b8ae0e6f942a3cfc74d | 3,279 | py | Python | topology_sdk/model/container/resource_requirements_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | 5 | 2019-07-31T04:11:05.000Z | 2021-01-07T03:23:20.000Z | topology_sdk/model/container/resource_requirements_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | topology_sdk/model/container/resource_requirements_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: resource_requirements.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 googl... | 39.506024 | 372 | 0.798719 |
8027b5d9e74ab6e57a4eccb125f723d80b4e9d24 | 453 | py | Python | dgcrm/migrations/0023_auto_20170702_1919.py | DenysGurin/solnce | 233a7b9fb6b717c8e421552ba16b353700afc1b0 | [
"MIT"
] | null | null | null | dgcrm/migrations/0023_auto_20170702_1919.py | DenysGurin/solnce | 233a7b9fb6b717c8e421552ba16b353700afc1b0 | [
"MIT"
] | null | null | null | dgcrm/migrations/0023_auto_20170702_1919.py | DenysGurin/solnce | 233a7b9fb6b717c8e421552ba16b353700afc1b0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-07-02 19:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dgcrm', '0022_auto_20170702_1917'),
]
operations = [
migrations.AlterField(... | 21.571429 | 58 | 0.611479 |
0db76ee5e1ecd4728efe57b19c9cfc3d4dc3ecc2 | 51,838 | py | Python | pytest_cases/fixture_parametrize_plus.py | AnesBenmerzoug/python-pytest-cases | 8febdeeb52f6dcfcb54aa1e8e7d966427d030ad5 | [
"BSD-3-Clause"
] | null | null | null | pytest_cases/fixture_parametrize_plus.py | AnesBenmerzoug/python-pytest-cases | 8febdeeb52f6dcfcb54aa1e8e7d966427d030ad5 | [
"BSD-3-Clause"
] | null | null | null | pytest_cases/fixture_parametrize_plus.py | AnesBenmerzoug/python-pytest-cases | 8febdeeb52f6dcfcb54aa1e8e7d966427d030ad5 | [
"BSD-3-Clause"
] | null | null | null | # Authors: Sylvain MARIE <sylvain.marie@se.com>
# + All contributors to <https://github.com/smarie/python-pytest-cases>
#
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
from collections import Iterable
from inspect import isgeneratorfunction
from warnings import wa... | 49.558317 | 122 | 0.612003 |
64fb0af142406dfa013533b6366814fdaf6ec49a | 3,166 | py | Python | lama/qc/metric_charts.py | MiaRatkovic/LAMA | 3ccfed0864001c8c270861e23cc81bc43d7d25c9 | [
"Apache-2.0"
] | 6 | 2016-08-15T22:07:02.000Z | 2022-02-17T04:22:58.000Z | lama/qc/metric_charts.py | MiaRatkovic/LAMA | 3ccfed0864001c8c270861e23cc81bc43d7d25c9 | [
"Apache-2.0"
] | 25 | 2019-12-05T02:02:20.000Z | 2021-09-08T01:39:17.000Z | lama/qc/metric_charts.py | MiaRatkovic/LAMA | 3ccfed0864001c8c270861e23cc81bc43d7d25c9 | [
"Apache-2.0"
] | 5 | 2019-12-05T00:15:29.000Z | 2021-07-06T05:24:54.000Z | #!/usr/bin/env python
"""
Given a directory containing a multi-level registration, make plots of the cost function for each resolution.
Creates a html report concatentating all the images into one.
"""
ITER_PREFIX = 'IterationInfo'
CSS_FILE = 'style.css'
import os
from os.path import join, relpath
import matplotlib
... | 35.177778 | 122 | 0.631712 |
5a0aa1af6a4adef94f744fa06ce2331c1ce00c35 | 1,130 | py | Python | src/integrationtest/python/should_list_single_task_for_simple_project_tests.py | AlexeySanko/pybuilder | 82acc02dd50b243049158815822acceb2d474713 | [
"Apache-2.0"
] | null | null | null | src/integrationtest/python/should_list_single_task_for_simple_project_tests.py | AlexeySanko/pybuilder | 82acc02dd50b243049158815822acceb2d474713 | [
"Apache-2.0"
] | null | null | null | src/integrationtest/python/should_list_single_task_for_simple_project_tests.py | AlexeySanko/pybuilder | 82acc02dd50b243049158815822acceb2d474713 | [
"Apache-2.0"
] | 1 | 2020-11-02T10:06:11.000Z | 2020-11-02T10:06:11.000Z | # -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2015 PyBuilder Team
#
# 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/l... | 27.560976 | 76 | 0.700885 |
f70f8ec2299360b366ee181be4fd170341ad6326 | 869 | py | Python | Inflearn_SungKim/1.LinearRegression/LinearRegression(placeholders).py | shinhaha/tensorflow | 4647017a727985d64c5b0addee92f0ec516952c1 | [
"MIT"
] | null | null | null | Inflearn_SungKim/1.LinearRegression/LinearRegression(placeholders).py | shinhaha/tensorflow | 4647017a727985d64c5b0addee92f0ec516952c1 | [
"MIT"
] | null | null | null | Inflearn_SungKim/1.LinearRegression/LinearRegression(placeholders).py | shinhaha/tensorflow | 4647017a727985d64c5b0addee92f0ec516952c1 | [
"MIT"
] | null | null | null | import tensorflow as tf
#placeholder variable(scalar)
X=tf.placeholder(tf.float32,shape=[None])
Y=tf.placeholder(tf.float32,shape=[None])
W=tf.Variable(tf.random_normal([1]),name='weight')
b=tf.Variable(tf.random_normal([1]),name='bias')
hypothesis=X*W+b
#average
cost=tf.reduce_mean(tf.square(hypothesis-Y))
optimiz... | 27.15625 | 63 | 0.727273 |
5d56a7c637f60064bb9aa2f5ee354759dfab99b8 | 658 | py | Python | fakesite/http_auth/tests/test_basic.py | akun/fakesite | 19d984011424dba9b9c7641e4ce3603605dd0d43 | [
"MIT"
] | 2 | 2015-12-20T06:57:20.000Z | 2022-03-17T10:26:57.000Z | fakesite/http_auth/tests/test_basic.py | akun/fakesite | 19d984011424dba9b9c7641e4ce3603605dd0d43 | [
"MIT"
] | null | null | null | fakesite/http_auth/tests/test_basic.py | akun/fakesite | 19d984011424dba9b9c7641e4ce3603605dd0d43 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from tornado.testing import AsyncHTTPTestCase as TestCase
from fakesite.fake_server import get_application
class BasicHandlerTestCase(TestCase):
def get_app(self):
return get_application()
def test_handler_if_with_auth(self):
response = self.fetch('/http_auth/basic',... | 27.416667 | 72 | 0.700608 |
92815a93c9db829ccc7db2b5be5010d74837a83b | 382 | py | Python | third_party/blink/tools/web_tests_history.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 575 | 2015-06-18T23:58:20.000Z | 2022-03-23T09:32:39.000Z | third_party/blink/tools/web_tests_history.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 113 | 2015-05-04T09:58:14.000Z | 2022-01-31T19:35:03.000Z | third_party/blink/tools/web_tests_history.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 52 | 2015-07-14T10:40:50.000Z | 2022-03-15T01:11:49.000Z | #!/usr/bin/env vpython
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
from blinkpy.common import version_check # pylint: disable=unused-import
from blinkpy.web_tests.web_tests_history import ... | 29.384615 | 73 | 0.769634 |
595a4244a467887796dcf163dd5d3914b86a0d90 | 772 | py | Python | src/rf.py | ScottNicholsonKurland/Capstone | 139df7255e8e09366fb67eaa2256f5dd97f1cd54 | [
"BSD-2-Clause"
] | 1 | 2018-01-22T15:37:51.000Z | 2018-01-22T15:37:51.000Z | src/rf.py | ScottNicholsonKurland/Capstone | 139df7255e8e09366fb67eaa2256f5dd97f1cd54 | [
"BSD-2-Clause"
] | null | null | null | src/rf.py | ScottNicholsonKurland/Capstone | 139df7255e8e09366fb67eaa2256f5dd97f1cd54 | [
"BSD-2-Clause"
] | null | null | null | from sklearn import datasets
from sklearn.ensemble import RandomForestRegressor
from sklearn.model_selection import train_test_split
df=pd.read_csv('Issued_Construction_Permits.csv')
dfa=df[df['TotalNewAddSQFT']>0]
iris=dfa[['OriginalZip','Longitude','Latitude','TotalNewAddSQFT', 'TotalJobValuation','NumberOfFloors']]... | 35.090909 | 104 | 0.784974 |
dc3ba8a2525a148851b928ff39696e76233e45ec | 136,041 | py | Python | tests/test_s3.py | mcripps9/cloud-custodian | dcd9cdfed9c9bbbe8f1b8959cacb2a815b978aa5 | [
"Apache-2.0"
] | 3 | 2018-01-18T12:10:53.000Z | 2019-01-03T20:00:52.000Z | tests/test_s3.py | mcripps9/cloud-custodian | dcd9cdfed9c9bbbe8f1b8959cacb2a815b978aa5 | [
"Apache-2.0"
] | 1 | 2018-12-11T19:31:13.000Z | 2018-12-11T19:31:13.000Z | tests/test_s3.py | mcripps9/cloud-custodian | dcd9cdfed9c9bbbe8f1b8959cacb2a815b978aa5 | [
"Apache-2.0"
] | 2 | 2018-11-15T20:32:50.000Z | 2022-01-25T18:26:48.000Z | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import datetime
import functools
import json
import os
import io
import shutil
import tempfile
import time # NOQA needed for some recordings
from unittest import TestCase
from botocore.exceptions import ClientError
from dateutil.tz import... | 35.932647 | 99 | 0.502922 |
64633dc6d86239b5c5b82889229d40323f6f4018 | 31,339 | py | Python | lazypredict/Supervised.py | dataprofessor/lazypredict | 563a4982547f0a5fba399b0920c30e9d8dc2ed32 | [
"MIT"
] | 6 | 2021-01-16T17:11:39.000Z | 2021-09-28T11:22:28.000Z | lazypredict/Supervised.py | dataprofessor/lazypredict | 563a4982547f0a5fba399b0920c30e9d8dc2ed32 | [
"MIT"
] | null | null | null | lazypredict/Supervised.py | dataprofessor/lazypredict | 563a4982547f0a5fba399b0920c30e9d8dc2ed32 | [
"MIT"
] | 2 | 2021-01-29T11:11:17.000Z | 2021-09-28T11:22:29.000Z | """
Supervised Models
"""
# Author: Shankar Rao Pandala <shankar.pandala@live.com>
import numpy as np
import pandas as pd
from tqdm import tqdm
import datetime
import time
import sklearn
from sklearn.pipeline import Pipeline
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.preprocessing import S... | 44.64245 | 141 | 0.535371 |
57a23e28061d1bd231cafed7f1e1bf33d964fd10 | 19,483 | py | Python | async_http/protocol.py | denismakogon/async-http | 508e3d694598708d1abae9f50aac18b7b84bd523 | [
"Apache-2.0"
] | null | null | null | async_http/protocol.py | denismakogon/async-http | 508e3d694598708d1abae9f50aac18b7b84bd523 | [
"Apache-2.0"
] | null | null | null | async_http/protocol.py | denismakogon/async-http | 508e3d694598708d1abae9f50aac18b7b84bd523 | [
"Apache-2.0"
] | null | null | null | import asyncio
import traceback
from httptools import HttpRequestParser
from httptools.parser.errors import HttpParserError
from .exceptions import (
InvalidUsage,
PayloadTooLarge,
RequestTimeout,
ServerError,
ServiceUnavailable,
)
from .request import Request, StreamBuffer
from .response import ... | 34.361552 | 79 | 0.587281 |
0796c7ba171d094a2a11344f1dbdb9dc3a9be5eb | 1,365 | py | Python | train_net.py | TanviAgg/AVT-local | 8f31cc4b85da2b0b08345ac507331f69fbf6da02 | [
"Apache-2.0"
] | null | null | null | train_net.py | TanviAgg/AVT-local | 8f31cc4b85da2b0b08345ac507331f69fbf6da02 | [
"Apache-2.0"
] | null | null | null | train_net.py | TanviAgg/AVT-local | 8f31cc4b85da2b0b08345ac507331f69fbf6da02 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
"""Main training entry."""
import os
import logging
import random
import subprocess
import torch
import hydra
from omegaconf import DictConfig, OmegaConf
import func
OmegaConf.register_new_resolver('minus', lambda x, y: x - y)
# Multiply and cast to integer
Omega... | 30.333333 | 75 | 0.651282 |
40400739e203e99f4dfd3746ea32ae3b017c9917 | 65,139 | py | Python | v2/shell.py | hybrid-storage-dev/cinder-client-fs-111t-hybrid-cherry | dad5632c91190c179479dcec58c13c655b839122 | [
"Apache-2.0"
] | null | null | null | v2/shell.py | hybrid-storage-dev/cinder-client-fs-111t-hybrid-cherry | dad5632c91190c179479dcec58c13c655b839122 | [
"Apache-2.0"
] | null | null | null | v2/shell.py | hybrid-storage-dev/cinder-client-fs-111t-hybrid-cherry | dad5632c91190c179479dcec58c13c655b839122 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013-2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 33.838442 | 83 | 0.611907 |
5cf2599bffc5fecdce3aa41431d633a282b39396 | 913 | py | Python | migrations/versions/375bc72d1423_.py | Zarkantho/placebo.gov | 829f3e2c45b7d0454e7245d1dc688687b2ffeb54 | [
"BSD-3-Clause"
] | null | null | null | migrations/versions/375bc72d1423_.py | Zarkantho/placebo.gov | 829f3e2c45b7d0454e7245d1dc688687b2ffeb54 | [
"BSD-3-Clause"
] | null | null | null | migrations/versions/375bc72d1423_.py | Zarkantho/placebo.gov | 829f3e2c45b7d0454e7245d1dc688687b2ffeb54 | [
"BSD-3-Clause"
] | null | null | null | """empty message
Revision ID: 375bc72d1423
Revises: 4cd5bb2931c
Create Date: 2015-05-09 22:02:15.181823
"""
# revision identifiers, used by Alembic.
revision = '375bc72d1423'
down_revision = '4cd5bb2931c'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - pl... | 26.085714 | 63 | 0.670318 |
6be5bebe5ada0f086eeb10ef2597c8cb31f31db1 | 23,124 | py | Python | evennia/utils/dbserialize.py | fermuch/evennia | 8961baa0a5b9b5419f864a144f080acc68a7ad0f | [
"BSD-3-Clause"
] | null | null | null | evennia/utils/dbserialize.py | fermuch/evennia | 8961baa0a5b9b5419f864a144f080acc68a7ad0f | [
"BSD-3-Clause"
] | null | null | null | evennia/utils/dbserialize.py | fermuch/evennia | 8961baa0a5b9b5419f864a144f080acc68a7ad0f | [
"BSD-3-Clause"
] | null | null | null | """
This module handles serialization of arbitrary python structural data,
intended primarily to be stored in the database. It also supports
storing Django model instances (which plain pickle cannot do).
This serialization is used internally by the server, notably for
storing data in Attributes and for piping data to ... | 33.367965 | 105 | 0.628697 |
7eb4dae8bbb90e790e8622722c072a8f540dad44 | 6,297 | py | Python | src/agent.py | jhonsonlee/ddpg-in-reacher-env | f49b3dc219c89dc5adffbd96580849b36c66e4af | [
"MIT"
] | null | null | null | src/agent.py | jhonsonlee/ddpg-in-reacher-env | f49b3dc219c89dc5adffbd96580849b36c66e4af | [
"MIT"
] | 7 | 2019-12-16T22:20:20.000Z | 2022-02-10T01:31:07.000Z | src/agent.py | jhonsonlee/ddpg-in-reacher-env | f49b3dc219c89dc5adffbd96580849b36c66e4af | [
"MIT"
] | null | null | null | import numpy as np
import random
import copy
from collections import namedtuple, deque
from src.model import Actor, Critic
import torch
import torch.nn.functional as F
import torch.optim as optim
BUFFER_SIZE = int(1e5) # replay buffer size
BATCH_SIZE = 128 # minibatch size
GAMMA = 0.99 # discount ... | 39.111801 | 127 | 0.631412 |
fe6db1f388ee0b5fa2c6aa9b1e6807333c82341b | 1,762 | py | Python | solutions/542.updateMatrix.py | lim1202/LeetCodeProblems | 26d8f799296da846dec284ccea07097d5cdcc1f1 | [
"MIT"
] | null | null | null | solutions/542.updateMatrix.py | lim1202/LeetCodeProblems | 26d8f799296da846dec284ccea07097d5cdcc1f1 | [
"MIT"
] | null | null | null | solutions/542.updateMatrix.py | lim1202/LeetCodeProblems | 26d8f799296da846dec284ccea07097d5cdcc1f1 | [
"MIT"
] | null | null | null | """
542. 01 Matrix
Given an m x n binary matrix mat, return the distance of the nearest 0 for each cell.
The distance between two adjacent cells is 1.
Example 1:
Input: mat = [[0,0,0],[0,1,0],[0,0,0]]
Output: [[0,0,0],[0,1,0],[0,0,0]]
Example 2:
Input: mat = [[0,0,0],[0,1,0],[1,1,1]]
Output: [[0,0,0],[0,1,0],[1,... | 24.816901 | 85 | 0.473326 |
062676a6978006735abefb7f9b1b05ce3b2c49fa | 15,395 | py | Python | tools/accuracy_checker/openvino/tools/accuracy_checker/evaluators/custom_evaluators/text_to_speech_evaluator.py | kblaszczak-intel/open_model_zoo | e313674d35050d2a4721bbccd9bd4c404f1ba7f8 | [
"Apache-2.0"
] | 2,201 | 2018-10-15T14:37:19.000Z | 2020-07-16T02:05:51.000Z | tools/accuracy_checker/openvino/tools/accuracy_checker/evaluators/custom_evaluators/text_to_speech_evaluator.py | kblaszczak-intel/open_model_zoo | e313674d35050d2a4721bbccd9bd4c404f1ba7f8 | [
"Apache-2.0"
] | 759 | 2018-10-18T07:43:55.000Z | 2020-07-16T01:23:12.000Z | tools/accuracy_checker/openvino/tools/accuracy_checker/evaluators/custom_evaluators/text_to_speech_evaluator.py | kblaszczak-intel/open_model_zoo | e313674d35050d2a4721bbccd9bd4c404f1ba7f8 | [
"Apache-2.0"
] | 808 | 2018-10-16T14:03:49.000Z | 2020-07-15T11:41:45.000Z | """
Copyright (c) 2018-2022 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | 47.223926 | 118 | 0.678142 |
aff22265dd36901db91828beb9b6d5b4e2b96a85 | 179,623 | py | Python | tensorflow/python/keras/backend.py | Faagerholm/tensorflow | 98e30b8748eb018f33836ac9269db67ab60483ab | [
"Apache-2.0"
] | 1 | 2019-06-10T12:00:23.000Z | 2019-06-10T12:00:23.000Z | tensorflow/python/keras/backend.py | Faagerholm/tensorflow | 98e30b8748eb018f33836ac9269db67ab60483ab | [
"Apache-2.0"
] | null | null | null | tensorflow/python/keras/backend.py | Faagerholm/tensorflow | 98e30b8748eb018f33836ac9269db67ab60483ab | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 31.457618 | 113 | 0.665627 |
76dcb47b417a015f2c1674070b2e2ddd7af1feb6 | 419 | py | Python | utils.py | albina77/bio | 18d46bc12ad5f40ed44a995c87010e2504653313 | [
"Apache-2.0"
] | null | null | null | utils.py | albina77/bio | 18d46bc12ad5f40ed44a995c87010e2504653313 | [
"Apache-2.0"
] | null | null | null | utils.py | albina77/bio | 18d46bc12ad5f40ed44a995c87010e2504653313 | [
"Apache-2.0"
] | null | null | null | from typing import List
from models import Generation
def filter_generation_by_index(generations: List[Generation], generation_index: int = 0):
generation_list = list(filter(lambda generation: generation.index == generation_index, generations))
if not generation_list:
raise AttributeError(f"Поколения... | 19.045455 | 104 | 0.763723 |
331973e9ccbee270dc61589ecf90116dac216f9d | 658 | py | Python | src/djanban/apps/boards/migrations/0068_auto_20170515_1844.py | diegojromerolopez/djanban | 6451688d49cf235d03c604b19a6a8480b33eed87 | [
"MIT"
] | 33 | 2017-06-14T18:04:25.000Z | 2021-06-15T07:07:56.000Z | src/djanban/apps/boards/migrations/0068_auto_20170515_1844.py | diegojromerolopez/djanban | 6451688d49cf235d03c604b19a6a8480b33eed87 | [
"MIT"
] | 1 | 2017-05-10T08:45:55.000Z | 2017-05-10T08:45:55.000Z | src/djanban/apps/boards/migrations/0068_auto_20170515_1844.py | diegojromerolopez/djanban | 6451688d49cf235d03c604b19a6a8480b33eed87 | [
"MIT"
] | 8 | 2017-08-27T11:14:25.000Z | 2021-03-03T12:11:16.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-15 16:44
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('boards', '0067_auto_20170515_1839'),
]
operations = ... | 28.608696 | 187 | 0.667173 |
371fe9434cf7e6181a916e34450ae03e63d80de5 | 4,113 | py | Python | evaluation.py | WANGDow/Video_Based_Guitarist_Performance | bf27d1a817ff12e67e22f2f07a95a5e984962dd8 | [
"MIT"
] | null | null | null | evaluation.py | WANGDow/Video_Based_Guitarist_Performance | bf27d1a817ff12e67e22f2f07a95a5e984962dd8 | [
"MIT"
] | null | null | null | evaluation.py | WANGDow/Video_Based_Guitarist_Performance | bf27d1a817ff12e67e22f2f07a95a5e984962dd8 | [
"MIT"
] | null | null | null | '''
Author: WANG Zichen
The Evaluation class which carries out the whole evaluation procedure,
including video modification, keypoints extraction, data preparation,
and result generation.
'''
import torch
import numpy as np
from training import NotSimpleNet
from video_edit import EditVideo
from coor_extrac... | 36.078947 | 120 | 0.63506 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.