hexsha
stringlengths
40
40
size
int64
2
1.02M
ext
stringclasses
10 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
6
130
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
245
max_issues_repo_name
stringlengths
6
130
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
245
max_forks_repo_name
stringlengths
6
130
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
2
1.02M
avg_line_length
float64
1
417k
max_line_length
int64
1
987k
alphanum_fraction
float64
0
1
content_no_comment
stringlengths
0
1.01M
is_comment_constant_removed
bool
1 class
is_sharp_comment_removed
bool
1 class
1c43bcddd351165d681ed76a72205a2d674eab7f
4,026
py
Python
cdtcommon/calculator.py
Just-Jojo/mcoc-v3
41c69960c8aff2dbbfd5d11ecc17e7af73e1e305
[ "MIT" ]
3
2020-08-09T03:03:20.000Z
2020-12-13T19:01:07.000Z
cdtcommon/calculator.py
Just-Jojo/mcoc-v3
41c69960c8aff2dbbfd5d11ecc17e7af73e1e305
[ "MIT" ]
19
2020-07-24T00:37:51.000Z
2021-06-18T17:22:14.000Z
cdtcommon/calculator.py
Just-Jojo/mcoc-v3
41c69960c8aff2dbbfd5d11ecc17e7af73e1e305
[ "MIT" ]
7
2020-06-30T20:09:08.000Z
2021-02-20T03:48:09.000Z
import math import re import discord from redbot.core import checks, commands from redbot.core.config import Config from .cdtcommon import CdtCommon from .cdtembed import Embed class Calculator(commands.Cog): """Calculator""" def __init__(self, bot): self.bot = bot self.thum...
38.711538
118
0.544709
import math import re import discord from redbot.core import checks, commands from redbot.core.config import Config from .cdtcommon import CdtCommon from .cdtembed import Embed class Calculator(commands.Cog): def __init__(self, bot): self.bot = bot self.thumbnail = "https://www.e...
true
true
1c43bd3bebe28921f0af5e1ac829a25b07e7fc62
10,912
py
Python
qiskit/pulse/pulse_lib/samplers/decorators.py
lerongil/qiskit-terra
a25af2a2378bc3d4f5ec73b948d048d1b707454c
[ "Apache-2.0" ]
3
2019-05-19T17:39:38.000Z
2020-01-28T19:59:18.000Z
qiskit/pulse/pulse_lib/samplers/decorators.py
lerongil/qiskit-terra
a25af2a2378bc3d4f5ec73b948d048d1b707454c
[ "Apache-2.0" ]
4
2019-05-13T15:28:46.000Z
2019-12-19T20:47:02.000Z
qiskit/pulse/pulse_lib/samplers/decorators.py
lerongil/qiskit-terra
a25af2a2378bc3d4f5ec73b948d048d1b707454c
[ "Apache-2.0" ]
1
2021-07-07T16:55:41.000Z
2021-07-07T16:55:41.000Z
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2019. # # 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...
38.971429
100
0.701155
import functools from typing import Callable import textwrap import pydoc import numpy as np import qiskit.pulse.commands as commands from . import strategies def _update_annotations(discretized_pulse: Callable) -> Callable: undecorated_annotations = list(discretized_pulse.__annotations__.items()) deco...
true
true
1c43be1b50051126e52c822f3f6ff0e79cfbfacb
3,517
py
Python
simplex_method.py
dvapan/simplex_method
dcc930b092dffa2e55162ea035f43d85572c8568
[ "MIT" ]
null
null
null
simplex_method.py
dvapan/simplex_method
dcc930b092dffa2e55162ea035f43d85572c8568
[ "MIT" ]
null
null
null
simplex_method.py
dvapan/simplex_method
dcc930b092dffa2e55162ea035f43d85572c8568
[ "MIT" ]
null
null
null
# coding=utf-8 __author__ = 'dvapan' import scipy as sc import scipy.linalg as lin import pprint # # c = sc.matrix([2.0, 3.0]).transpose() # A = sc.matrix([[-10.0, 5.0], [6.0, 20.0], [8.0, 15.0]]) # b = sc.matrix([600.0, 600.0, 600.0]).transpose() # I = [2, 3, 4] def transform_to_classic(A,b,c): count_vars = A....
29.308333
91
0.562411
__author__ = 'dvapan' import scipy as sc import scipy.linalg as lin import pprint def transform_to_classic(A,b,c): count_vars = A.shape[1] addition_vars = A.shape[0] count_all_vars = count_vars + addition_vars _A = sc.resize(A, (A.shape[0], count_all_vars)) _A[:, :count_vars] = A _A[:, count...
true
true
1c43beac38a9be1ebc96e5f4db2e17a1f69ebb88
24,223
py
Python
python/process_content.py
tdjames1/TMA-data-extraction
03af0ef3b61df5486f6f061e4e3b62de2e238476
[ "BSD-3-Clause" ]
null
null
null
python/process_content.py
tdjames1/TMA-data-extraction
03af0ef3b61df5486f6f061e4e3b62de2e238476
[ "BSD-3-Clause" ]
5
2021-01-05T12:14:53.000Z
2021-08-23T09:18:11.000Z
python/process_content.py
tdjames1/TMA-data-extraction
03af0ef3b61df5486f6f061e4e3b62de2e238476
[ "BSD-3-Clause" ]
1
2021-02-18T14:59:42.000Z
2021-02-18T14:59:42.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- """tma_process_content .. module:: TMA-data-extraction :synopis: Scripts and functions for extracting weather alert data from Tanzanian Meteorological Authority "Five days Severe weather impact-based forecasts" PDFs. .. moduleauthor: Tamora D. James <t.d.james1@...
35.054993
131
0.509103
import sys import argparse import os import numpy as np import numpy.linalg as LA import bezier import matplotlib.pyplot as plt import matplotlib.patches as mpatches from matplotlib.path import Path import cartopy.crs as ccrs import cartopy.feature as cfeature import cartopy.io.shapereader as shpreader import skima...
true
true
1c43c028cb0bd6fa2468ee77c1143f9fda2d934e
66,798
py
Python
nipyapi/registry/apis/bundles_api.py
iMajna/nipyapi
5480af8fe8c6b470249837835cb1a067abb6678e
[ "Apache-2.0" ]
null
null
null
nipyapi/registry/apis/bundles_api.py
iMajna/nipyapi
5480af8fe8c6b470249837835cb1a067abb6678e
[ "Apache-2.0" ]
1
2020-03-16T10:02:46.000Z
2020-03-16T13:37:42.000Z
nipyapi/registry/apis/bundles_api.py
iMajna/nipyapi
5480af8fe8c6b470249837835cb1a067abb6678e
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 """ Apache NiFi Registry REST API The REST API provides an interface to a registry with operations for saving, versioning, reading NiFi flows and components. OpenAPI spec version: 0.7.0 Contact: dev@nifi.apache.org Generated by: https://github.com/swagger-api/swagger-codegen.git "...
47.918221
357
0.600243
from __future__ import absolute_import import sys import os import re from six import iteritems from ..configuration import Configuration from ..api_client import ApiClient class BundlesApi(object): def __init__(self, api_client=None): config = Configuration() if api_client: sel...
true
true
1c43c04f2267901e6a6439f5190e528fae312122
23,661
py
Python
vt/client.py
kesh-stripe/vt-py
00ec3743cfc8649c84d3aabc45986177f468bd71
[ "Apache-2.0" ]
null
null
null
vt/client.py
kesh-stripe/vt-py
00ec3743cfc8649c84d3aabc45986177f468bd71
[ "Apache-2.0" ]
null
null
null
vt/client.py
kesh-stripe/vt-py
00ec3743cfc8649c84d3aabc45986177f468bd71
[ "Apache-2.0" ]
null
null
null
# Copyright © 2019 The vt-py 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 applicable l...
37.261417
91
0.711677
import aiohttp import asyncio import base64 import json from .error import APIError from .feed import Feed from .object import Object from .iterator import Iterator from .version import __version__ __all__ = [ 'Client', 'ClientResponse', 'url_id'] _API_HOST = 'https://www.virustotal.com' # prefix in ...
true
true
1c43c0fdce2f9815a2113123cb5ee97352dd4dee
1,064
py
Python
leaderboard/models.py
Fredrik3B/kultspill_backend
8aad6431f36dad46ef06f4da40f2bc63c6185dd2
[ "MIT" ]
1
2021-03-11T13:24:55.000Z
2021-03-11T13:24:55.000Z
leaderboard/models.py
Fredrik3B/kultspill_backend
8aad6431f36dad46ef06f4da40f2bc63c6185dd2
[ "MIT" ]
null
null
null
leaderboard/models.py
Fredrik3B/kultspill_backend
8aad6431f36dad46ef06f4da40f2bc63c6185dd2
[ "MIT" ]
null
null
null
from django.db import models from django.contrib.auth.models import User from django.db.models.fields import PositiveIntegerField # Create your models here. class Player(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) playername = models.CharField(max_length=30) highscore_arcade ...
31.294118
76
0.737782
from django.db import models from django.contrib.auth.models import User from django.db.models.fields import PositiveIntegerField class Player(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) playername = models.CharField(max_length=30) highscore_arcade = models.PositiveIntegerFie...
true
true
1c43c29935b123c3b372d55287a8e6ceb0dc1d18
1,596
py
Python
visitor_counter/utils/test_db.py
jcromerohdz/FlaskDev
29539259cba3a0e18c205fb439ee916fb12e5318
[ "MIT" ]
null
null
null
visitor_counter/utils/test_db.py
jcromerohdz/FlaskDev
29539259cba3a0e18c205fb439ee916fb12e5318
[ "MIT" ]
null
null
null
visitor_counter/utils/test_db.py
jcromerohdz/FlaskDev
29539259cba3a0e18c205fb439ee916fb12e5318
[ "MIT" ]
null
null
null
import os from flask_sqlalchemy import sqlalchemy class TestDB: def __init__(self): self.db_name = os.environ['DATABASE_NAME'] + '_test' self.db_host = os.environ['DB_HOST'] self.db_root_password = os.environ['POSTGRES_ROOT_PASSWORD'] if self.db_root_password: self.db_us...
38.926829
154
0.624687
import os from flask_sqlalchemy import sqlalchemy class TestDB: def __init__(self): self.db_name = os.environ['DATABASE_NAME'] + '_test' self.db_host = os.environ['DB_HOST'] self.db_root_password = os.environ['POSTGRES_ROOT_PASSWORD'] if self.db_root_password: self.db_us...
true
true
1c43c2a3742fc0d3c893cf6ca0a6a729e50cb27d
1,672
py
Python
src/programy/processors/pre/stemming.py
NeolithEra/program-y
8c2396611f30c8095e98ff02988223a641c1a3be
[ "MIT" ]
null
null
null
src/programy/processors/pre/stemming.py
NeolithEra/program-y
8c2396611f30c8095e98ff02988223a641c1a3be
[ "MIT" ]
null
null
null
src/programy/processors/pre/stemming.py
NeolithEra/program-y
8c2396611f30c8095e98ff02988223a641c1a3be
[ "MIT" ]
null
null
null
""" Copyright (c) 2016-2019 Keith Sterling http://www.keithsterling.com 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 rights to use, copy, m...
47.771429
120
0.785885
from programy.utils.logging.ylogger import YLogger from programy.processors.processing import PreProcessor from programy.nlp.stemming import Stemmer class StemmingPreProcessor(PreProcessor): def __init__(self): PreProcessor.__init__(self) def process(self, context, word_string): YLogger.d...
true
true
1c43c2a3c540a69b7c7955a52ca5fcfac255bb4a
488
py
Python
DCNN-Pytorch/shape_testing.py
linklab-uva/deepracing
fc25c47658277df029e7399d295d97a75fe85216
[ "Apache-2.0" ]
11
2020-06-29T15:21:37.000Z
2021-04-12T00:42:26.000Z
DCNN-Pytorch/shape_testing.py
linklab-uva/deepracing
fc25c47658277df029e7399d295d97a75fe85216
[ "Apache-2.0" ]
null
null
null
DCNN-Pytorch/shape_testing.py
linklab-uva/deepracing
fc25c47658277df029e7399d295d97a75fe85216
[ "Apache-2.0" ]
4
2019-01-23T23:36:57.000Z
2021-07-02T00:18:37.000Z
import torch import deepracing_models.nn_models.Models as M import time #net = M.AdmiralNetKinematicPredictor(use_3dconv=False, sequence_length=20, context_length=5) net = M.AdmiralNetCurvePredictor(use_3dconv=True, context_length=5, params_per_dimension=6) net = net.cuda(0) im = torch.rand(64,5,3,66,200) im = im.cuda(...
30.5
93
0.764344
import torch import deepracing_models.nn_models.Models as M import time net = M.AdmiralNetCurvePredictor(use_3dconv=True, context_length=5, params_per_dimension=6) net = net.cuda(0) im = torch.rand(64,5,3,66,200) im = im.cuda(0) net=net.eval() print(net) print("Running net") tick = time.time() out = net(im) tock = time...
true
true
1c43c356ac0bdcea6eceba09900f788aa2884b63
1,000
py
Python
isi_sdk_8_1_1/test/test_storagepool_settings_extended.py
mohitjain97/isilon_sdk_python
a371f438f542568edb8cda35e929e6b300b1177c
[ "Unlicense" ]
24
2018-06-22T14:13:23.000Z
2022-03-23T01:21:26.000Z
isi_sdk_8_1_1/test/test_storagepool_settings_extended.py
mohitjain97/isilon_sdk_python
a371f438f542568edb8cda35e929e6b300b1177c
[ "Unlicense" ]
46
2018-04-30T13:28:22.000Z
2022-03-21T21:11:07.000Z
isi_sdk_8_1_1/test/test_storagepool_settings_extended.py
mohitjain97/isilon_sdk_python
a371f438f542568edb8cda35e929e6b300b1177c
[ "Unlicense" ]
29
2018-06-19T00:14:04.000Z
2022-02-08T17:51:19.000Z
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 6 Contact: sdk@isilon.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import isi_sdk_8_1_1 from i...
24.390244
112
0.734
from __future__ import absolute_import import unittest import isi_sdk_8_1_1 from isi_sdk_8_1_1.models.storagepool_settings_extended import StoragepoolSettingsExtended from isi_sdk_8_1_1.rest import ApiException class TestStoragepoolSettingsExtended(unittest.TestCase): def setUp(self): pass def...
true
true
1c43c36c2ada9f5d833ee6c1c64f1c7f9dff279a
113
py
Python
dexy/reporters/nodegraph/__init__.py
dsoto/dexy
0f2090250040c3c54c8481a16de8e476b559e87c
[ "MIT" ]
136
2015-01-06T15:04:47.000Z
2021-12-21T22:52:41.000Z
dexy/reporters/nodegraph/__init__.py
dsoto/dexy
0f2090250040c3c54c8481a16de8e476b559e87c
[ "MIT" ]
13
2015-01-26T14:06:58.000Z
2020-03-27T21:16:10.000Z
dexy/reporters/nodegraph/__init__.py
dsoto/dexy
0f2090250040c3c54c8481a16de8e476b559e87c
[ "MIT" ]
34
2015-01-02T16:24:53.000Z
2021-11-27T05:38:30.000Z
import dexy.reporters.nodegraph.d3 import dexy.reporters.nodegraph.text import dexy.reporters.nodegraph.graphviz
28.25
40
0.867257
import dexy.reporters.nodegraph.d3 import dexy.reporters.nodegraph.text import dexy.reporters.nodegraph.graphviz
true
true
1c43c4671697267b7379d98f325b8b8c320e8e61
3,078
py
Python
cv/models.py
ezraermy/mkcv
a75ec4144b313d1f92795da582d988634cd4ac7c
[ "MIT" ]
null
null
null
cv/models.py
ezraermy/mkcv
a75ec4144b313d1f92795da582d988634cd4ac7c
[ "MIT" ]
null
null
null
cv/models.py
ezraermy/mkcv
a75ec4144b313d1f92795da582d988634cd4ac7c
[ "MIT" ]
null
null
null
from django.db import models from phonenumber_field.modelfields import PhoneNumberField # Create your models here. class CVmaker(models.Model): title = models.CharField(max_length=255, null=True) def __str__(self): return self.title class Meta: verbose_name_plural = 'CVmaker' class E...
34.58427
110
0.649773
from django.db import models from phonenumber_field.modelfields import PhoneNumberField class CVmaker(models.Model): title = models.CharField(max_length=255, null=True) def __str__(self): return self.title class Meta: verbose_name_plural = 'CVmaker' class Employee(models.Model): ...
true
true
1c43c476a29fee110ef9fc498803191a11545755
35,260
py
Python
meta_dataset/learners/experimental/optimization_learners.py
shikanggao/meta-dataset
7b1e99009516eda3bbd5e740e178ebc37e2d6767
[ "Apache-2.0" ]
null
null
null
meta_dataset/learners/experimental/optimization_learners.py
shikanggao/meta-dataset
7b1e99009516eda3bbd5e740e178ebc37e2d6767
[ "Apache-2.0" ]
null
null
null
meta_dataset/learners/experimental/optimization_learners.py
shikanggao/meta-dataset
7b1e99009516eda3bbd5e740e178ebc37e2d6767
[ "Apache-2.0" ]
null
null
null
# coding=utf-8 # Copyright 2021 The Meta-Dataset Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
37.71123
80
0.713244
from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import itertools import gin.tf from meta_dataset.learners.experimental import base as learner_base from meta_dataset.models.experimental import reparameterizable_backbones from meta_datas...
true
true
1c43c5bfecaed4e7e8964c995dae337fc39d6831
126
py
Python
server/app.py
ZhiShiMao/one
313c64a47e563fabf9b24e67c52308daff6912e3
[ "MIT" ]
null
null
null
server/app.py
ZhiShiMao/one
313c64a47e563fabf9b24e67c52308daff6912e3
[ "MIT" ]
null
null
null
server/app.py
ZhiShiMao/one
313c64a47e563fabf9b24e67c52308daff6912e3
[ "MIT" ]
null
null
null
from fastapi import FastAPI from .api import routers app = FastAPI() for router in routers: app.include_router(router)
14
30
0.753968
from fastapi import FastAPI from .api import routers app = FastAPI() for router in routers: app.include_router(router)
true
true
1c43c887f1307042e07971b032b7bf4181a998aa
2,327
py
Python
ion/services/coi/object_management_service.py
ooici/coi-services
43246f46a82e597345507afd7dfc7373cb346afa
[ "BSD-2-Clause" ]
3
2016-09-20T09:50:06.000Z
2018-08-10T01:41:38.000Z
ion/services/coi/object_management_service.py
ooici/coi-services
43246f46a82e597345507afd7dfc7373cb346afa
[ "BSD-2-Clause" ]
null
null
null
ion/services/coi/object_management_service.py
ooici/coi-services
43246f46a82e597345507afd7dfc7373cb346afa
[ "BSD-2-Clause" ]
2
2016-03-16T22:25:49.000Z
2016-11-26T14:54:21.000Z
#!/usr/bin/env python __author__ = 'Stephen P. Henrie' from interface.services.coi.iobject_management_service import BaseObjectManagementService from pyon.util.containers import is_basic_identifier from pyon.core.exception import BadRequest, NotFound from pyon.core.interfaces.interface_util import is_yaml_string_va...
33.724638
89
0.647615
__author__ = 'Stephen P. Henrie' from interface.services.coi.iobject_management_service import BaseObjectManagementService from pyon.util.containers import is_basic_identifier from pyon.core.exception import BadRequest, NotFound from pyon.core.interfaces.interface_util import is_yaml_string_valid class ObjectMana...
true
true
1c43c91efb5c15cc4a8aef6be89a5b65609db2e1
633
py
Python
src/manage.py
ravihansa/django-multiple-user-auth
7b6d1c783fc72d30cb7a5bcdf3a262f6ac0772b1
[ "bzip2-1.0.6" ]
1
2019-10-07T15:26:24.000Z
2019-10-07T15:26:24.000Z
src/manage.py
ravihansa/django-multiple-user-auth
7b6d1c783fc72d30cb7a5bcdf3a262f6ac0772b1
[ "bzip2-1.0.6" ]
null
null
null
src/manage.py
ravihansa/django-multiple-user-auth
7b6d1c783fc72d30cb7a5bcdf3a262f6ac0772b1
[ "bzip2-1.0.6" ]
null
null
null
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'multiUserAuth.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise ...
28.772727
77
0.685624
import os import sys def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'multiUserAuth.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import Django. Are you sure it's installed and " ...
true
true
1c43c9505cca8a34ef1bc2f328835501e9ee524a
969
py
Python
django/contrib/admin/decorators.py
ni-ning/django
2e7ba6057cfc82a15a22b6021cd60cf307152e2d
[ "CNRI-Python-GPL-Compatible", "BSD-3-Clause" ]
7
2021-03-18T10:21:34.000Z
2022-02-09T12:54:51.000Z
virtual/lib/python3.6/site-packages/django/contrib/admin/decorators.py
kahenya-anita/Insta-Clone
4894e959c17170505e73aee6dc497aeb29d55a71
[ "MIT" ]
61
2021-01-10T12:59:01.000Z
2021-06-24T09:19:20.000Z
virtual/lib/python3.6/site-packages/django/contrib/admin/decorators.py
kahenya-anita/Insta-Clone
4894e959c17170505e73aee6dc497aeb29d55a71
[ "MIT" ]
7
2021-03-15T13:39:20.000Z
2022-03-29T12:08:21.000Z
def register(*models, site=None): """ Register the given model(s) classes and wrapped ModelAdmin class with admin site: @register(Author) class AuthorAdmin(admin.ModelAdmin): pass The `site` kwarg is an admin site to use instead of the default admin site. """ from django.contri...
31.258065
79
0.691434
def register(*models, site=None): from django.contrib.admin import ModelAdmin from django.contrib.admin.sites import AdminSite, site as default_site def _model_admin_wrapper(admin_class): if not models: raise ValueError('At least one model must be passed to register.') admin_si...
true
true
1c43cac183ab237cc74013825695bd82ee649cd5
1,123
py
Python
CODE/models/.ipynb_checkpoints/regression-checkpoint.py
happyfuntimegroup/machinelearning
48b381092736591e4685faafdddc713391922266
[ "MIT" ]
1
2021-12-07T12:38:33.000Z
2021-12-07T12:38:33.000Z
CODE/models/regression.py
SelinZ/machinelearning
105273b2cf5907b23a2ee2b4c076d89f215c38ff
[ "MIT" ]
12
2021-11-30T13:57:48.000Z
2021-12-07T08:33:18.000Z
CODE/models/regression.py
SelinZ/machinelearning
105273b2cf5907b23a2ee2b4c076d89f215c38ff
[ "MIT" ]
1
2021-12-07T12:38:00.000Z
2021-12-07T12:38:00.000Z
def simple_linear(X_train, y_train, X_val, y_val): from sklearn.linear_model import LinearRegression from sklearn.metrics import r2_score, mean_absolute_error model = LinearRegression() reg = model.fit(X = X_train, y = y_train) y_pred_val = model.predict(X_val) print(r2_score(y_val, y_pred_val)...
34.030303
80
0.719501
def simple_linear(X_train, y_train, X_val, y_val): from sklearn.linear_model import LinearRegression from sklearn.metrics import r2_score, mean_absolute_error model = LinearRegression() reg = model.fit(X = X_train, y = y_train) y_pred_val = model.predict(X_val) print(r2_score(y_val, y_pred_val)...
true
true
1c43cad59151b333a58e3e9bbe73d9671373383e
6,744
py
Python
spider/quanmin_anchor.py
AcerFeng/Zhudao
5a36d0dc7bd718ce03aa476a31b36d7b5230b1b7
[ "MIT" ]
null
null
null
spider/quanmin_anchor.py
AcerFeng/Zhudao
5a36d0dc7bd718ce03aa476a31b36d7b5230b1b7
[ "MIT" ]
null
null
null
spider/quanmin_anchor.py
AcerFeng/Zhudao
5a36d0dc7bd718ce03aa476a31b36d7b5230b1b7
[ "MIT" ]
1
2018-09-13T07:41:44.000Z
2018-09-13T07:41:44.000Z
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Created on 2018-01-25 00:45:53 # Project: quanmin_anchor from pyspider.libs.base_handler import * import pymysql from datetime import datetime class Handler(BaseHandler): headers = { 'Host': 'www.quanmin.tv', 'Connection': 'Keep-Alive', 'A...
40.626506
270
0.361358
from pyspider.libs.base_handler import * import pymysql from datetime import datetime class Handler(BaseHandler): headers = { 'Host': 'www.quanmin.tv', 'Connection': 'Keep-Alive', 'Accept-Encoding': 'gzip', 'User-Agent': 'okhttp/3.9.1', } crawl_config = { 'itag': ...
true
true
1c43cad729128c44137a71f706001f60a8c1b995
100
py
Python
modules/ESP8266/ota.py
ccccmagicboy/MicroPython_fw
d2049bc19e3d5010f5d6d0d17aa13a8693914fbd
[ "MIT" ]
4
2020-02-02T20:12:59.000Z
2020-07-20T15:44:07.000Z
modules/ESP8266/ota.py
ccccmagicboy/MicroPython_fw
d2049bc19e3d5010f5d6d0d17aa13a8693914fbd
[ "MIT" ]
10
2020-02-18T09:57:04.000Z
2020-03-04T11:39:17.000Z
modules/ESP8266/ota.py
ccccmagicboy/MicroPython_fw
d2049bc19e3d5010f5d6d0d17aa13a8693914fbd
[ "MIT" ]
null
null
null
import machine def start(): machine.RTC().memory('yaotaota') machine.reset()
12.5
36
0.57
import machine def start(): machine.RTC().memory('yaotaota') machine.reset()
true
true
1c43cb3436d953b4031542e8c7c48bea06d83265
11,467
py
Python
ovsdbapp/api.py
Sharpeye90/ovsdbapp
6577bbd5e80cdbe95207211d4d47f43b121f2c86
[ "Apache-2.0" ]
34
2017-03-24T10:14:33.000Z
2021-11-19T05:04:54.000Z
ovsdbapp/api.py
Sharpeye90/ovsdbapp
6577bbd5e80cdbe95207211d4d47f43b121f2c86
[ "Apache-2.0" ]
2
2021-09-21T13:23:01.000Z
2021-09-21T13:23:28.000Z
ovsdbapp/api.py
Sharpeye90/ovsdbapp
6577bbd5e80cdbe95207211d4d47f43b121f2c86
[ "Apache-2.0" ]
15
2017-07-06T08:00:52.000Z
2022-03-13T10:29:40.000Z
# Copyright (c) 2014 OpenStack Foundation # # 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 ...
40.235088
79
0.616552
import abc import contextlib import threading class Command(object, metaclass=abc.ABCMeta): @abc.abstractmethod def execute(self, **transaction_options): class Transaction(object, metaclass=abc.ABCMeta): @abc.abstractmethod def commit(self): @abc.abstractmethod def add(self, command): ...
true
true
1c43cb8e251561f5ffb61eedf812dca217fee446
524
py
Python
mysite/ads/views.py
MarcosSalib/mysite_django
593c9758eeff0b9f536fe6dd2a84a8097ed1850e
[ "MIT" ]
null
null
null
mysite/ads/views.py
MarcosSalib/mysite_django
593c9758eeff0b9f536fe6dd2a84a8097ed1850e
[ "MIT" ]
null
null
null
mysite/ads/views.py
MarcosSalib/mysite_django
593c9758eeff0b9f536fe6dd2a84a8097ed1850e
[ "MIT" ]
null
null
null
from django.views import View from .owner import OwnerListView, OwnerDetailView, OwnerCreateView, OwnerUpdateView, OwnerDeleteView from .models import Ad # Create your views here. class AdListView(OwnerListView): model = Ad class AdDetailView(OwnerDetailView): model = Ad class AdCreateView(OwnerCreateView)...
20.96
100
0.727099
from django.views import View from .owner import OwnerListView, OwnerDetailView, OwnerCreateView, OwnerUpdateView, OwnerDeleteView from .models import Ad class AdListView(OwnerListView): model = Ad class AdDetailView(OwnerDetailView): model = Ad class AdCreateView(OwnerCreateView): model = Ad field...
true
true
1c43cbadac49f2a6bc13476f9326555357353823
1,364
py
Python
app.py
eshaan7/IPU_GPA_Calculator
19744864525ceb6de5bd7b6c5c5467870c0281ac
[ "MIT" ]
6
2019-06-12T09:58:14.000Z
2019-07-28T23:13:28.000Z
app.py
eshaan7/IPU_GPA_Calculator
19744864525ceb6de5bd7b6c5c5467870c0281ac
[ "MIT" ]
1
2019-06-24T13:57:21.000Z
2019-06-24T13:57:21.000Z
app.py
Eshaan7/IPU_GPA_Calculator
19744864525ceb6de5bd7b6c5c5467870c0281ac
[ "MIT" ]
3
2019-06-12T09:58:16.000Z
2019-08-26T20:08:17.000Z
import os from flask import Flask, render_template, request, redirect, url_for app = Flask(__name__) app.secret_key = "66b58fafa6a470f26fd2adc9de14cef2" ''' PWA Stuff ''' # only trigger SSLify if the app is running on Heroku if 'DYNO' in os.environ: from flask_sslify import SSLify sslify = SSLify(app) @app.route(...
29.021277
88
0.691349
import os from flask import Flask, render_template, request, redirect, url_for app = Flask(__name__) app.secret_key = "66b58fafa6a470f26fd2adc9de14cef2" if 'DYNO' in os.environ: from flask_sslify import SSLify sslify = SSLify(app) @app.route('/sw.js', methods=['GET']) def sw(): return app.send_static_file('sw...
true
true
1c43cc4bdaf1de7725864b1cb397715c2bbf7991
1,517
py
Python
main.py
yelite/RoomMonitor
2a1699478aa91ec001fe691c1160e7ac7f7f291d
[ "MIT" ]
null
null
null
main.py
yelite/RoomMonitor
2a1699478aa91ec001fe691c1160e7ac7f7f291d
[ "MIT" ]
null
null
null
main.py
yelite/RoomMonitor
2a1699478aa91ec001fe691c1160e7ac7f7f291d
[ "MIT" ]
null
null
null
#coding=utf-8 from datetime import datetime, timedelta from flask import Flask, render_template, g, jsonify from model import Data from helper import gen_unpack_func from fetch import fetch app = Flask(__name__) def get_session(): session = getattr(g, '_session', None) if session is None: from db...
23.338462
92
0.607779
from datetime import datetime, timedelta from flask import Flask, render_template, g, jsonify from model import Data from helper import gen_unpack_func from fetch import fetch app = Flask(__name__) def get_session(): session = getattr(g, '_session', None) if session is None: from db import Sessio...
true
true
1c43ce98895617da79c14c62c224e64da0d934dc
335
py
Python
notes/algo-ds-practice/problems/dp/kadane.py
Anmol-Singh-Jaggi/interview-notes
65af75e2b5725894fa5e13bb5cd9ecf152a0d652
[ "MIT" ]
6
2020-07-05T05:15:19.000Z
2021-01-24T20:17:14.000Z
notes/algo-ds-practice/problems/dp/kadane.py
Anmol-Singh-Jaggi/interview-notes
65af75e2b5725894fa5e13bb5cd9ecf152a0d652
[ "MIT" ]
null
null
null
notes/algo-ds-practice/problems/dp/kadane.py
Anmol-Singh-Jaggi/interview-notes
65af75e2b5725894fa5e13bb5cd9ecf152a0d652
[ "MIT" ]
2
2020-09-14T06:46:37.000Z
2021-06-15T09:17:21.000Z
def kadane(arr): max_global = -1e9 max_local = max_global for elem in arr: max_local = max(elem, elem + max_local) max_global = max(max_global, max_local) return max_global def main(): arr = [-2, -3, 4, -1, -2, 1, 5, -3] ret = kadane(arr) print(ret) if __name__ == "__main...
19.705882
47
0.576119
def kadane(arr): max_global = -1e9 max_local = max_global for elem in arr: max_local = max(elem, elem + max_local) max_global = max(max_global, max_local) return max_global def main(): arr = [-2, -3, 4, -1, -2, 1, 5, -3] ret = kadane(arr) print(ret) if __name__ == "__main...
true
true
1c43d004d4a185b1bfb3c178eb285b0d6056337f
2,100
py
Python
llvm-spirv/test/lit.cfg.py
Ralender/sycl
1fcd1e6d3da10024be92148501aced30ae3aa2be
[ "Apache-2.0" ]
1
2020-09-25T23:33:05.000Z
2020-09-25T23:33:05.000Z
llvm-spirv/test/lit.cfg.py
Ralender/sycl
1fcd1e6d3da10024be92148501aced30ae3aa2be
[ "Apache-2.0" ]
null
null
null
llvm-spirv/test/lit.cfg.py
Ralender/sycl
1fcd1e6d3da10024be92148501aced30ae3aa2be
[ "Apache-2.0" ]
null
null
null
# -*- Python -*- import lit.formats import lit.util from lit.llvm import llvm_config from lit.llvm.subst import ToolSubst from lit.llvm.subst import FindTool # Configuration file for the 'lit' test runner. # name: The name of this test suite. config.name = 'LLVM_SPIRV' # testFormat: The test format to use to inter...
33.870968
115
0.748571
import lit.formats import lit.util from lit.llvm import llvm_config from lit.llvm.subst import ToolSubst from lit.llvm.subst import FindTool config.name = 'LLVM_SPIRV' config.test_format = lit.formats.ShTest(True) config.suffixes = ['.cl', '.ll', '.spt'] config.excludes = ['CMakeLists.txt'] if not config.spirv_...
true
true
1c43d04f11f00dcdcc7312268a8db53989c15597
28,424
py
Python
swift/common/request_helpers.py
Priyanka-Askani/swift
1ab691f63778008015b34ce004992844acee9968
[ "Apache-2.0" ]
1
2019-05-25T10:55:58.000Z
2019-05-25T10:55:58.000Z
swift/common/request_helpers.py
Priyanka-Askani/swift
1ab691f63778008015b34ce004992844acee9968
[ "Apache-2.0" ]
12
2015-06-23T23:20:17.000Z
2016-01-27T00:37:12.000Z
swift/common/request_helpers.py
Priyanka-Askani/swift
1ab691f63778008015b34ce004992844acee9968
[ "Apache-2.0" ]
5
2015-06-04T19:00:11.000Z
2015-12-16T21:04:33.000Z
# Copyright (c) 2010-2013 OpenStack Foundation # # 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 agree...
39.587744
79
0.63369
import hashlib import itertools import sys import time import six from six.moves.urllib.parse import unquote from swift.common.header_key_dict import HeaderKeyDict from swift import gettext_ as _ from swift.common.storage_policy import POLICIES from swift.common.exceptions import ListingIterError, SegmentError from...
true
true
1c43d04ffcbbf8f8291758e9efda58952ca0da53
1,510
py
Python
nengolib/stats/ortho.py
ikajic/nengolib
bd30ec38ba656bedb94a267b5f86b51d1cec4954
[ "MIT" ]
27
2016-01-21T04:11:02.000Z
2021-11-16T20:41:04.000Z
nengolib/stats/ortho.py
ikajic/nengolib
bd30ec38ba656bedb94a267b5f86b51d1cec4954
[ "MIT" ]
178
2016-01-21T16:04:34.000Z
2021-05-01T16:28:02.000Z
nengolib/stats/ortho.py
ikajic/nengolib
bd30ec38ba656bedb94a267b5f86b51d1cec4954
[ "MIT" ]
4
2019-03-19T18:22:02.000Z
2021-03-23T16:06:57.000Z
import numpy as np from scipy.linalg import svd from nengo.dists import UniformHypersphere __all__ = ['random_orthogonal'] def random_orthogonal(d, rng=None): """Returns a random orthogonal matrix. Parameters ---------- d : ``integer`` Positive dimension of returned matrix. rng : :clas...
26.964286
65
0.598675
import numpy as np from scipy.linalg import svd from nengo.dists import UniformHypersphere __all__ = ['random_orthogonal'] def random_orthogonal(d, rng=None): rng = np.random if rng is None else rng m = UniformHypersphere(surface=True).sample(d, d, rng=rng) u, s, v = svd(m) return np.dot(u, v)
true
true
1c43d0671192f23cc6c504e35209d21603155e04
5,160
py
Python
wikimapper/cli.py
jcklie/wikimapper
fadecea085bfa11779e33e94b03a8dcdd2d045a7
[ "Apache-2.0" ]
69
2019-05-07T02:41:57.000Z
2022-03-29T09:33:43.000Z
wikimapper/cli.py
jcklie/wikimapper
fadecea085bfa11779e33e94b03a8dcdd2d045a7
[ "Apache-2.0" ]
6
2019-04-26T11:16:07.000Z
2021-04-08T15:35:33.000Z
wikimapper/cli.py
jcklie/wikimapper
fadecea085bfa11779e33e94b03a8dcdd2d045a7
[ "Apache-2.0" ]
7
2020-02-14T20:00:23.000Z
2021-12-17T09:56:19.000Z
import argparse import logging import os from wikimapper.__version__ import __version__ from wikimapper import download_wikidumps, create_index, WikiMapper def main(): logging.basicConfig( level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s" ) description = "Map Wik...
34.630872
193
0.650775
import argparse import logging import os from wikimapper.__version__ import __version__ from wikimapper import download_wikidumps, create_index, WikiMapper def main(): logging.basicConfig( level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s" ) description = "Map Wik...
true
true
1c43d0fc92643c28afe3143be964b00509b6b818
22,725
py
Python
build/lib/pspnet/pspnet.py
NamTran838P/pspnet-keras
4005fd7867036e5476bcc694fd2f548a22860d4b
[ "MIT" ]
null
null
null
build/lib/pspnet/pspnet.py
NamTran838P/pspnet-keras
4005fd7867036e5476bcc694fd2f548a22860d4b
[ "MIT" ]
null
null
null
build/lib/pspnet/pspnet.py
NamTran838P/pspnet-keras
4005fd7867036e5476bcc694fd2f548a22860d4b
[ "MIT" ]
null
null
null
#!/usr/bin/env python """ A Keras/Tensorflow implementation of Pyramid Scene Parsing Networks. Original paper & code published by Hengshuang Zhao et al. (2017) """ from __future__ import print_function from __future__ import division from os.path import splitext, join, isfile, isdir from os import environ, wa...
45.089286
169
0.602552
from __future__ import print_function from __future__ import division from os.path import splitext, join, isfile, isdir from os import environ, walk from math import ceil import argparse import glob import fnmatch import warnings import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets impo...
true
true
1c43d13e1d7ae8c436ac089155e651917aefd88c
5,603
py
Python
Parser-hybrid/nparser/neural/models/nlp/parsers/gama_parser.py
sb-b/BOUN-PARSE
2b529924897d8e2613c4d2193a67796a895da40b
[ "Apache-2.0" ]
12
2020-03-04T17:36:12.000Z
2021-09-26T14:02:49.000Z
Parser-hybrid/nparser/neural/models/nlp/parsers/gama_parser.py
sb-b/BOUN-PARSE
2b529924897d8e2613c4d2193a67796a895da40b
[ "Apache-2.0" ]
1
2020-12-09T08:21:11.000Z
2020-12-09T08:21:11.000Z
Parser-hybrid/nparser/neural/models/nlp/parsers/gama_parser.py
sb-b/BOUN-PARSE
2b529924897d8e2613c4d2193a67796a895da40b
[ "Apache-2.0" ]
3
2020-11-18T09:53:42.000Z
2020-12-17T23:04:59.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2016 Timothy Dozat # # 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 ...
41.198529
164
0.622345
import numpy as np import tensorflow as tf from nparser.neural.models.nlp.parsers.base_parser import BaseParser class GamaParser(BaseParser): def __call__(self, vocabs, moving_params=None): top_recur = super(GamaParser, self).__call__(vocabs, moving_params=moving_params) int_tokens_to_keep =...
true
true
1c43d18889a0f6900709ccbbcf70196aa6da5678
6,236
py
Python
db_comm_messages.py
seeul8er/DroneBridge_Comm
156ef546f4680084acc94c34f9ed3caeecf23585
[ "Apache-2.0" ]
1
2017-11-29T17:06:37.000Z
2017-11-29T17:06:37.000Z
db_comm_messages.py
seeul8er/DroneBridge_Comm
156ef546f4680084acc94c34f9ed3caeecf23585
[ "Apache-2.0" ]
null
null
null
db_comm_messages.py
seeul8er/DroneBridge_Comm
156ef546f4680084acc94c34f9ed3caeecf23585
[ "Apache-2.0" ]
null
null
null
import json import configparser import binascii from itertools import chain import os tag = 'DB_COMM_MESSAGE: ' PATH_DRONEBRIDGE_TX_SETTINGS = "/boot/DroneBridgeTX.ini" PATH_DRONEBRIDGE_RX_SETTINGS = "/boot/DroneBridgeRX.ini" PATH_WBC_SETTINGS = "/boot/wifibroadcast-1.txt" # As we send it as a single frame we do not ...
37.341317
121
0.642559
import json import configparser import binascii from itertools import chain import os tag = 'DB_COMM_MESSAGE: ' PATH_DRONEBRIDGE_TX_SETTINGS = "/boot/DroneBridgeTX.ini" PATH_DRONEBRIDGE_RX_SETTINGS = "/boot/DroneBridgeRX.ini" PATH_WBC_SETTINGS = "/boot/wifibroadcast-1.txt" wbc_settings_blacklist = ["TXMODE", "MAC_RX[...
true
true
1c43d22b596fddf6286a515cf1c8f75f7f260ee6
1,209
py
Python
common/message_forwarder.py
matthewdargan/Cozmo-Capture-the-Flag
959467ed6ebaeeb42fe60db5905e49963b5d2096
[ "MIT" ]
null
null
null
common/message_forwarder.py
matthewdargan/Cozmo-Capture-the-Flag
959467ed6ebaeeb42fe60db5905e49963b5d2096
[ "MIT" ]
null
null
null
common/message_forwarder.py
matthewdargan/Cozmo-Capture-the-Flag
959467ed6ebaeeb42fe60db5905e49963b5d2096
[ "MIT" ]
1
2019-03-05T17:12:07.000Z
2019-03-05T17:12:07.000Z
import socket from socket import error as socket_error from typing import List def start_connection(ip: str, port: int) -> socket.socket: """ Start a connection to a TCP network. :param ip ip address of the network :param port port number to forward messages over :return: socket opened with the i...
25.1875
80
0.649297
import socket from socket import error as socket_error from typing import List def start_connection(ip: str, port: int) -> socket.socket: try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) except socket_error: print("Connection failed.") try: s.connect((ip, port)) exc...
true
true
1c43d37c4d3866bf302fa057cdab10f32428ea99
953
py
Python
cohesity_management_sdk/models/search_job_status_enum.py
nick6655/management-sdk-python
88e792cb83e5c24a22af495b220c145d0c45841d
[ "Apache-2.0" ]
18
2019-09-24T17:35:53.000Z
2022-03-25T08:08:47.000Z
cohesity_management_sdk/models/search_job_status_enum.py
nick6655/management-sdk-python
88e792cb83e5c24a22af495b220c145d0c45841d
[ "Apache-2.0" ]
18
2019-03-29T19:32:29.000Z
2022-01-03T23:16:45.000Z
cohesity_management_sdk/models/search_job_status_enum.py
nick6655/management-sdk-python
88e792cb83e5c24a22af495b220c145d0c45841d
[ "Apache-2.0" ]
16
2019-02-27T06:54:12.000Z
2021-11-16T18:10:24.000Z
# -*- coding: utf-8 -*- # Copyright 2021 Cohesity Inc. class SearchJobStatusEnum(object): """Implementation of the 'SearchJobStatus' enum. Specifies the status of the search. 'kJobRunning' indicates that the Job/task is currently running. 'kJobFinished' indicates that the Job/task completed and finis...
28.029412
73
0.699895
class SearchJobStatusEnum(object): KJOBRUNNING = 'kJobRunning' KJOBFINISHED = 'kJobFinished' KJOBFAILED = 'kJobFailed' KJOBCANCELED = 'kJobCanceled' KJOBPAUSED = 'kJobPaused'
true
true
1c43d38f9620e64fb551b35cd7d5f96e522ca4e4
96
py
Python
spark_surveymonkey/__init__.py
eferm/spark-surveymonkey
0912268c9604f32226d29b3d870296d781787a3a
[ "MIT" ]
null
null
null
spark_surveymonkey/__init__.py
eferm/spark-surveymonkey
0912268c9604f32226d29b3d870296d781787a3a
[ "MIT" ]
null
null
null
spark_surveymonkey/__init__.py
eferm/spark-surveymonkey
0912268c9604f32226d29b3d870296d781787a3a
[ "MIT" ]
null
null
null
from ._transform import transform_survey __version__ = '0.1.0' __all__ = ('transform_survey')
16
40
0.760417
from ._transform import transform_survey __version__ = '0.1.0' __all__ = ('transform_survey')
true
true
1c43d4b1509801a52270c7d65891a51a3a8e8637
10,527
py
Python
helpers/shuffleMockCatalog.py
manodeep/yymao-helpers
4ceffd639f4a10d259146f3f94e0b2415e835f32
[ "MIT" ]
null
null
null
helpers/shuffleMockCatalog.py
manodeep/yymao-helpers
4ceffd639f4a10d259146f3f94e0b2415e835f32
[ "MIT" ]
null
null
null
helpers/shuffleMockCatalog.py
manodeep/yymao-helpers
4ceffd639f4a10d259146f3f94e0b2415e835f32
[ "MIT" ]
null
null
null
__all__ = ['shuffleMockCatalog', 'generate_upid'] import warnings from itertools import izip import numpy as np from numpy.lib.recfunctions import rename_fields def _iter_plateau_in_sorted_array(a): if len(a): k = np.where(a[1:] != a[:-1])[0] k += 1 i = 0 for j in k: yie...
36.807692
80
0.595516
__all__ = ['shuffleMockCatalog', 'generate_upid'] import warnings from itertools import izip import numpy as np from numpy.lib.recfunctions import rename_fields def _iter_plateau_in_sorted_array(a): if len(a): k = np.where(a[1:] != a[:-1])[0] k += 1 i = 0 for j in k: yie...
true
true
1c43d5f43d8a82eed84cc58c3d38663d541a8be4
831
py
Python
accessible_output/speech/outputs/jaws.py
Timtam/cards-against-humanity
89ea61b5c9915198b845bbf8a93c3f7827323ceb
[ "MIT" ]
5
2017-04-11T00:18:42.000Z
2021-08-01T04:27:20.000Z
accessible_output/speech/outputs/jaws.py
Timtam/cards-against-humanity
89ea61b5c9915198b845bbf8a93c3f7827323ceb
[ "MIT" ]
47
2017-04-27T18:57:27.000Z
2017-07-16T21:18:28.000Z
accessible_output/speech/outputs/jaws.py
Timtam/cards-against-humanity
89ea61b5c9915198b845bbf8a93c3f7827323ceb
[ "MIT" ]
4
2018-05-17T12:33:59.000Z
2022-02-20T16:08:51.000Z
from pywintypes import com_error import win32gui import win32com.client from main import OutputError, ScreenreaderSpeechOutput class Jaws (ScreenreaderSpeechOutput): """Speech output supporting the Jaws for Windows screen reader.""" name = 'Jaws' def __init__(self, *args, **kwargs): super (Jaws, self).__init__...
26.806452
124
0.718412
from pywintypes import com_error import win32gui import win32com.client from main import OutputError, ScreenreaderSpeechOutput class Jaws (ScreenreaderSpeechOutput): name = 'Jaws' def __init__(self, *args, **kwargs): super (Jaws, self).__init__(*args, **kwargs) try: self.object = win32com.client.Dispatch("...
true
true
1c43d7479da3c0f98336c0c943df2ebf50f430e0
9,059
py
Python
algs/nsga_net/utils/utils.py
Beautyya/BenchENA
5f5491614fc2f00ca26dc29f35f44c334db4718c
[ "MIT" ]
null
null
null
algs/nsga_net/utils/utils.py
Beautyya/BenchENA
5f5491614fc2f00ca26dc29f35f44c334db4718c
[ "MIT" ]
null
null
null
algs/nsga_net/utils/utils.py
Beautyya/BenchENA
5f5491614fc2f00ca26dc29f35f44c334db4718c
[ "MIT" ]
null
null
null
import configparser import os import platform import multiprocessing from compute.file import get_algo_local_dir, get_local_path import time import os import numpy as np from algs.nsga_net.utils.statusupdatetool import StatusUpdateTool from algs.nsga_net.genetic.population import Population, Individual class Utils(ob...
40.084071
114
0.535821
import configparser import os import platform import multiprocessing from compute.file import get_algo_local_dir, get_local_path import time import os import numpy as np from algs.nsga_net.utils.statusupdatetool import StatusUpdateTool from algs.nsga_net.genetic.population import Population, Individual class Utils(ob...
true
true
1c43d78b35231ae2efb4db918cbc7bf068cee45e
4,547
py
Python
examples/mfa_extraction/fix_mismatch.py
geneing/TensorFlowTTS
0035ba00fec1b2b1184c8df32646d6a88b01ee5b
[ "Apache-2.0" ]
null
null
null
examples/mfa_extraction/fix_mismatch.py
geneing/TensorFlowTTS
0035ba00fec1b2b1184c8df32646d6a88b01ee5b
[ "Apache-2.0" ]
null
null
null
examples/mfa_extraction/fix_mismatch.py
geneing/TensorFlowTTS
0035ba00fec1b2b1184c8df32646d6a88b01ee5b
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # Copyright 2020 TensorFlowTTS 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 applicab...
34.44697
119
0.520563
import numpy as np import os from tqdm import tqdm import click import logging import sys logging.basicConfig( level=logging.DEBUG, stream=sys.stdout, format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s", ) @click.command() @click.option("--base_path", default="dump") @click.option("...
true
true
1c43dadf8de6f9e1d56a4de21587cb982ee0979e
3,531
py
Python
profiles_project/settings.py
CGarcia8CG/profiles-resst-api
2a31f66f875f006a437865999fb5dd63049b14ae
[ "MIT" ]
null
null
null
profiles_project/settings.py
CGarcia8CG/profiles-resst-api
2a31f66f875f006a437865999fb5dd63049b14ae
[ "MIT" ]
null
null
null
profiles_project/settings.py
CGarcia8CG/profiles-resst-api
2a31f66f875f006a437865999fb5dd63049b14ae
[ "MIT" ]
null
null
null
""" Django settings for profiles_project project. Generated by 'django-admin startproject' using Django 2.2. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ impor...
26.548872
91
0.708581
import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SECRET_KEY = 'u8&5lcphj96%8)2qf1bj*73i@p_p%_drs0$xrj44@o&6*txak!' DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes...
true
true
1c43db2740e3ecabf360bbab3b871d70e31d5cf0
938
py
Python
composite.py
sloev/photobooth_web
ed2799f30f43dbc8042476c3f9238ffb39ead3b5
[ "MIT" ]
null
null
null
composite.py
sloev/photobooth_web
ed2799f30f43dbc8042476c3f9238ffb39ead3b5
[ "MIT" ]
null
null
null
composite.py
sloev/photobooth_web
ed2799f30f43dbc8042476c3f9238ffb39ead3b5
[ "MIT" ]
null
null
null
from PIL import Image import os MAX_COLUMNS = 5 INPUT_DIR = './segments/' images = [Image.open(INPUT_DIR + filename) for filename in sorted(os.listdir(INPUT_DIR)) if filename.endswith('.png')] MAX_ROWS = int(len(images)/MAX_COLUMNS) + (1 if len(images) % 20 !=0 else 0) img_width, img_height = images[0].size print(M...
29.3125
118
0.689765
from PIL import Image import os MAX_COLUMNS = 5 INPUT_DIR = './segments/' images = [Image.open(INPUT_DIR + filename) for filename in sorted(os.listdir(INPUT_DIR)) if filename.endswith('.png')] MAX_ROWS = int(len(images)/MAX_COLUMNS) + (1 if len(images) % 20 !=0 else 0) img_width, img_height = images[0].size print(M...
true
true
1c43db677624e3a656cc3cea81f95f7b0f6b3c81
353
py
Python
bitcoin/metrics.py
darbik/work
7f5640822fc5bbbd4033385d6377878b22785cb2
[ "MIT" ]
null
null
null
bitcoin/metrics.py
darbik/work
7f5640822fc5bbbd4033385d6377878b22785cb2
[ "MIT" ]
3
2016-08-04T18:12:05.000Z
2016-08-09T16:55:09.000Z
bitcoin/metrics.py
darbik/bitcoin
7f5640822fc5bbbd4033385d6377878b22785cb2
[ "MIT" ]
null
null
null
from time import strftime def get_volume(atmid, price, amount): volume = (atmid, price, amount) return volume def get_time(atmid): time = (atmid, strftime("%Y-%m-%d %H:%M:%S")) # time format is in UTC return time def get_fees(atmid, price, amount): feesMade = (atmid, (amount / pric...
16.809524
79
0.620397
from time import strftime def get_volume(atmid, price, amount): volume = (atmid, price, amount) return volume def get_time(atmid): time = (atmid, strftime("%Y-%m-%d %H:%M:%S")) return time def get_fees(atmid, price, amount): feesMade = (atmid, (amount / price) * 0.05) return f...
true
true
1c43dbee4862a38bad9336f123d8fa764442b2cb
8,629
py
Python
torch_complex/complex_operation.py
veya2ztn/mltool
4ed151152845ebe3de128e1f53c478581c1492e4
[ "IJG" ]
null
null
null
torch_complex/complex_operation.py
veya2ztn/mltool
4ed151152845ebe3de128e1f53c478581c1492e4
[ "IJG" ]
null
null
null
torch_complex/complex_operation.py
veya2ztn/mltool
4ed151152845ebe3de128e1f53c478581c1492e4
[ "IJG" ]
null
null
null
import numpy as np import torch import torch.nn.functional as F def complex_mul(tensor_1: torch.Tensor,tensor_2: torch.Tensor,mode='cc')-> torch.Tensor: ''' :param tensor_1(2) [...,2] for real part and image part ''' if mode == 'cc': assert tensor_1.shape[-1]==2 assert tensor_2.shape[-1...
35.510288
111
0.571909
import numpy as np import torch import torch.nn.functional as F def complex_mul(tensor_1: torch.Tensor,tensor_2: torch.Tensor,mode='cc')-> torch.Tensor: if mode == 'cc': assert tensor_1.shape[-1]==2 assert tensor_2.shape[-1]==2 real1,imag1=tensor_1[...,0],tensor_1[...,1] real2,imag2...
true
true
1c43dcbc0e87b2b9319a3efe3dd0e07b164d11cd
36,802
py
Python
code_generation/code_generator_online.py
annihilatorrrr/pytgbot
2f84b11253873f7af1bc7539eb7d93197d51c90c
[ "MIT" ]
52
2015-06-25T15:48:19.000Z
2021-08-10T20:29:11.000Z
code_generation/code_generator_online.py
annihilatorrrr/pytgbot
2f84b11253873f7af1bc7539eb7d93197d51c90c
[ "MIT" ]
16
2016-04-12T08:11:30.000Z
2021-07-22T18:00:07.000Z
code_generation/code_generator_online.py
annihilatorrrr/pytgbot
2f84b11253873f7af1bc7539eb7d93197d51c90c
[ "MIT" ]
14
2015-06-26T15:29:48.000Z
2021-08-10T20:29:14.000Z
# -*- coding: utf-8 -*- from pathlib import Path from typing import Dict, List, Union from code_generator import get_type_path from code_generator_template import clazz, func, get_template, as_types from code_generator_classes import Clazz, Function, Variable, Type, Import, FunctionClazz from luckydonaldUtils.files.ba...
42.496536
266
0.597386
from pathlib import Path from typing import Dict, List, Union from code_generator import get_type_path from code_generator_template import clazz, func, get_template, as_types from code_generator_classes import Clazz, Function, Variable, Type, Import, FunctionClazz from luckydonaldUtils.files.basics import mkdir_p fro...
true
true
1c43ded31ce72ef1e9790a43940975d2e33defc8
42
py
Python
run.py
chrisbarr/bilious-rutabaga
b2d01f03c2cce8342f11139279870156c0ebc9c9
[ "MIT" ]
null
null
null
run.py
chrisbarr/bilious-rutabaga
b2d01f03c2cce8342f11139279870156c0ebc9c9
[ "MIT" ]
null
null
null
run.py
chrisbarr/bilious-rutabaga
b2d01f03c2cce8342f11139279870156c0ebc9c9
[ "MIT" ]
null
null
null
import bucket_lister bucket_lister.main()
14
20
0.857143
import bucket_lister bucket_lister.main()
true
true
1c43df75a6f017476d2000ddd8cfa609911e7416
48,453
py
Python
pymatgen/core/tests/test_structure.py
MahdiDavari/pymatgen
eb6cd95230c11ac761a96ebf82b98f71177bb71f
[ "MIT" ]
null
null
null
pymatgen/core/tests/test_structure.py
MahdiDavari/pymatgen
eb6cd95230c11ac761a96ebf82b98f71177bb71f
[ "MIT" ]
null
null
null
pymatgen/core/tests/test_structure.py
MahdiDavari/pymatgen
eb6cd95230c11ac761a96ebf82b98f71177bb71f
[ "MIT" ]
1
2018-04-09T21:49:14.000Z
2018-04-09T21:49:14.000Z
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals, print_function from pymatgen.util.testing import PymatgenTest from pymatgen.core.periodic_table import Element, Specie from pymatgen.core.composition import C...
42.878761
108
0.546137
from __future__ import division, unicode_literals, print_function from pymatgen.util.testing import PymatgenTest from pymatgen.core.periodic_table import Element, Specie from pymatgen.core.composition import Composition from pymatgen.core.operations import SymmOp from pymatgen.core.structure import IStructure, Struct...
true
true
1c43e0cada49727bd7584ef88bc5aea8845fc86a
9,387
py
Python
src/bondora_api/models/api_result_event_log.py
parruc/bondora_api
f36ea8d7149d75a2e5f14a695e5a4e57f0a3518d
[ "Apache-2.0" ]
8
2019-03-09T20:38:27.000Z
2021-02-10T20:44:22.000Z
src/bondora_api/models/api_result_event_log.py
parruc/bondora_api
f36ea8d7149d75a2e5f14a695e5a4e57f0a3518d
[ "Apache-2.0" ]
1
2018-03-06T09:44:21.000Z
2018-03-06T09:44:21.000Z
src/bondora_api/models/api_result_event_log.py
parruc/bondora_api
f36ea8d7149d75a2e5f14a695e5a4e57f0a3518d
[ "Apache-2.0" ]
3
2019-06-03T13:44:05.000Z
2020-11-16T13:17:38.000Z
# coding: utf-8 """ Bondora API V1 Bondora API version 1 OpenAPI spec version: v1 Contact: investor@bondora.com Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance ...
30.086538
132
0.584425
from pprint import pformat from six import iteritems import re class ApiResultEventLog(object): def __init__(self, page_size=None, page_nr=None, total_count=None, count=None, payload=None, success=None, errors=None): self.swagger_types = { 'page_size': 'int', 'page_nr': 'int', ...
true
true
1c43e0f431cee83160cd2cca89590f3101053b77
11,888
py
Python
geoflow1D/GeoModule.py
HerminioTH/GeoFlow1D
44a5c11e3297827b265c1ea44bb18256b074fa66
[ "MIT" ]
2
2020-02-10T11:23:16.000Z
2020-07-01T20:28:57.000Z
geoflow1D/GeoModule.py
HerminioTH/GeoFlow1D
44a5c11e3297827b265c1ea44bb18256b074fa66
[ "MIT" ]
null
null
null
geoflow1D/GeoModule.py
HerminioTH/GeoFlow1D
44a5c11e3297827b265c1ea44bb18256b074fa66
[ "MIT" ]
null
null
null
def AssemblyStiffnessMatrix(linearSystem, grid, props, uShift=0): for region in grid.getRegions(): M = props.M.getValue(region) for e in region.getElements(): dx = e.getLength() f = e.getFace() bIndex = f.getBackwardVertex().getIndex() + uShift*grid.getNumberOfVer...
46.619608
117
0.597662
def AssemblyStiffnessMatrix(linearSystem, grid, props, uShift=0): for region in grid.getRegions(): M = props.M.getValue(region) for e in region.getElements(): dx = e.getLength() f = e.getFace() bIndex = f.getBackwardVertex().getIndex() + uShift*grid.getNumberOfVer...
true
true
1c43e105b918ef473175c9aefbc7dbf6367f1764
22,146
py
Python
lib/utils/paf_to_pose.py
kacel33/ActionAI_PC
a0528f49ea61cc07d7c1e9a3cd6846e5f50cfae7
[ "MIT" ]
1,311
2017-03-28T09:24:20.000Z
2022-03-30T02:43:11.000Z
lib/utils/paf_to_pose.py
kacel33/ActionAI_PC
a0528f49ea61cc07d7c1e9a3cd6846e5f50cfae7
[ "MIT" ]
144
2017-05-09T16:35:40.000Z
2022-03-25T03:14:42.000Z
lib/utils/paf_to_pose.py
kacel33/ActionAI_PC
a0528f49ea61cc07d7c1e9a3cd6846e5f50cfae7
[ "MIT" ]
437
2017-03-30T15:23:14.000Z
2022-03-25T09:18:50.000Z
import cv2 import numpy as np import time from scipy.ndimage.filters import gaussian_filter, maximum_filter from scipy.ndimage.morphology import generate_binary_structure from lib.pafprocess import pafprocess from lib.utils.common import Human, BodyPart, CocoPart, CocoColors, CocoPairsRender # Heatmap indices to fin...
54.412776
136
0.635916
import cv2 import numpy as np import time from scipy.ndimage.filters import gaussian_filter, maximum_filter from scipy.ndimage.morphology import generate_binary_structure from lib.pafprocess import pafprocess from lib.utils.common import Human, BodyPart, CocoPart, CocoColors, CocoPairsRender joint_to_limb_heatmap_r...
true
true
1c43e13d8418e3f82d49ce71c1285cf8469339e2
387
py
Python
scp_epub/download/utils.py
elfakyn/scp_epub
5d0e95d8fa0e11d9ab388c5a4083212c1c857a2f
[ "MIT" ]
5
2020-05-27T15:57:15.000Z
2021-06-11T01:08:50.000Z
scp_epub/download/utils.py
elfakyn/scp_epub
5d0e95d8fa0e11d9ab388c5a4083212c1c857a2f
[ "MIT" ]
null
null
null
scp_epub/download/utils.py
elfakyn/scp_epub
5d0e95d8fa0e11d9ab388c5a4083212c1c857a2f
[ "MIT" ]
2
2020-11-14T04:53:51.000Z
2021-06-12T19:28:32.000Z
import re def filter_tags(pages, include_tags=None): if include_tags is not None: pages = [ page for page in pages if 'tags' in page and any( included_tag in page['tags'] for included_tag in include_tags ) ] return pages def normalize_stri...
21.5
77
0.578811
import re def filter_tags(pages, include_tags=None): if include_tags is not None: pages = [ page for page in pages if 'tags' in page and any( included_tag in page['tags'] for included_tag in include_tags ) ] return pages def normalize_stri...
true
true
1c43e2186ae5b7bd32f050d7f5b624c8bb3e6dc6
12,265
py
Python
offb_posctl/scripts/MinimumSnapTimeNode.py
SensenLiu/aggrecup
0c381ee259b388684205c1fa5fc41265a7e849b3
[ "MIT" ]
null
null
null
offb_posctl/scripts/MinimumSnapTimeNode.py
SensenLiu/aggrecup
0c381ee259b388684205c1fa5fc41265a7e849b3
[ "MIT" ]
null
null
null
offb_posctl/scripts/MinimumSnapTimeNode.py
SensenLiu/aggrecup
0c381ee259b388684205c1fa5fc41265a7e849b3
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- # coding=utf-8 import socket import numpy as np from scipy.optimize import minimize import time import datetime import math import matplotlib.pyplot as plt import rospy from nav_msgs.msg import Odometry from geometry_msgs.msg import TwistStamped from offb_posctl.msg impor...
45.594796
1,439
0.609458
import socket import numpy as np from scipy.optimize import minimize import time import datetime import math import matplotlib.pyplot as plt import rospy from nav_msgs.msg import Odometry from geometry_msgs.msg import TwistStamped from offb_posctl.msg import controlstate phi=1.57 ay0=0 vy0=0 y0=0 az0=0 vz0=0 z0=0.5...
true
true
1c43e31b2a6419a99dbce0307a341681e94bc888
27,753
py
Python
toontown/pickatoon/PickAToonOptions.py
cmarshall108/Project-Altis
7ead614abdb5072ca06323982de461f4e775d1b3
[ "Apache-2.0" ]
1
2021-02-25T06:02:04.000Z
2021-02-25T06:02:04.000Z
toontown/pickatoon/PickAToonOptions.py
AnythingTechPro/Project-Altis
7ead614abdb5072ca06323982de461f4e775d1b3
[ "Apache-2.0" ]
null
null
null
toontown/pickatoon/PickAToonOptions.py
AnythingTechPro/Project-Altis
7ead614abdb5072ca06323982de461f4e775d1b3
[ "Apache-2.0" ]
2
2021-02-25T06:02:05.000Z
2021-06-19T03:11:22.000Z
''' Created on Apr 2, 2016 @author: Drew ''' from direct.gui.DirectGui import * from direct.interval.IntervalGlobal import Wait, Func, Sequence, LerpColorScaleInterval, Parallel, LerpScaleInterval from direct.showbase.DirectObject import DirectObject from panda3d.core import TransparencyAttrib, Point3, Vec4, TextNode...
49.033569
431
0.644723
from direct.gui.DirectGui import * from direct.interval.IntervalGlobal import Wait, Func, Sequence, LerpColorScaleInterval, Parallel, LerpScaleInterval from direct.showbase.DirectObject import DirectObject from panda3d.core import TransparencyAttrib, Point3, Vec4, TextNode, Vec3 from toontown.toonbase import TTLocali...
true
true
1c43e36be51bc3b9156c0575a20c0ca5254421ba
1,708
py
Python
thirdParty/lxml/__init__.py
knittledan/Location_Search_Prediction
c96e3bfc0c73b646b9a7620bb1655285458fb20d
[ "MIT" ]
null
null
null
thirdParty/lxml/__init__.py
knittledan/Location_Search_Prediction
c96e3bfc0c73b646b9a7620bb1655285458fb20d
[ "MIT" ]
null
null
null
thirdParty/lxml/__init__.py
knittledan/Location_Search_Prediction
c96e3bfc0c73b646b9a7620bb1655285458fb20d
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- #---------------------------------------------------------------------------------------- # __init__.py initialization file for PIL #---------------------------------------------------------------------------------------- import os import sys import platform #----------------------------------...
30.5
89
0.384075
import os import sys import platform kMac = 0 kLinux = 1 kWindows = 2 currentDir = os.path.dirname(os.path.realpath(__file__)) version = sys.version_info[:2] if version == (2, 7): lxmlVersion = "lxml_py27" if version == (3, 2): lxmlVersion = "lxml_py32" def getOs(): name = platform.system() ...
true
true
1c43e4d4ab4dc301594d8265fd0f7be7719b47ae
2,611
py
Python
examples/plot_samples.py
AWehrhahn/exoplanet_transit_snr
f1bdaddb89e1c8b819651bcd2d80ed95d2a1fc0f
[ "MIT" ]
null
null
null
examples/plot_samples.py
AWehrhahn/exoplanet_transit_snr
f1bdaddb89e1c8b819651bcd2d80ed95d2a1fc0f
[ "MIT" ]
null
null
null
examples/plot_samples.py
AWehrhahn/exoplanet_transit_snr
f1bdaddb89e1c8b819651bcd2d80ed95d2a1fc0f
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import corner import emcee import matplotlib.pyplot as plt import numpy as np from astropy import units as u from exoorbit.orbit import Orbit from exoplanet_transit_snr.stellardb import StellarDb star, planet = "WASP-107", "b" datasets = {50: "WASP-107b_SNR50", 100: "WASP-107b_SNR100", 200: "W...
30.717647
105
0.640368
import corner import emcee import matplotlib.pyplot as plt import numpy as np from astropy import units as u from exoorbit.orbit import Orbit from exoplanet_transit_snr.stellardb import StellarDb star, planet = "WASP-107", "b" datasets = {50: "WASP-107b_SNR50", 100: "WASP-107b_SNR100", 200: "WASP-107b_SNR200"} sdb =...
true
true
1c43e6f20ef928918c97de09f2b91fbfbcc389dc
669
py
Python
app/core/management/commands/wait_for_db.py
amirhosseyn/Django-REST
e8c031c8e5d00ae5a9a8732b7c298bb9c2afa8f9
[ "MIT" ]
null
null
null
app/core/management/commands/wait_for_db.py
amirhosseyn/Django-REST
e8c031c8e5d00ae5a9a8732b7c298bb9c2afa8f9
[ "MIT" ]
null
null
null
app/core/management/commands/wait_for_db.py
amirhosseyn/Django-REST
e8c031c8e5d00ae5a9a8732b7c298bb9c2afa8f9
[ "MIT" ]
null
null
null
import time from django.db import connections from django.db.utils import OperationalError from django.core.management.base import BaseCommand class Command(BaseCommand): """Django command to pause execution until db is up 'n running""" def handle(self, *args, **options): self.stdout.write('Waiting ...
30.409091
77
0.647235
import time from django.db import connections from django.db.utils import OperationalError from django.core.management.base import BaseCommand class Command(BaseCommand): def handle(self, *args, **options): self.stdout.write('Waiting for database...') db_conn = None while not db_conn: ...
true
true
1c43e74182739e0186666a6172b8f37cc901b2d5
11,035
py
Python
mistral/services/scheduler.py
soda-research/mistral
550a3de9c2defc7ce26336cb705d9c8d87bbaddd
[ "Apache-2.0" ]
3
2015-08-28T04:57:56.000Z
2017-03-27T10:59:56.000Z
mistral/services/scheduler.py
soda-research/mistral
550a3de9c2defc7ce26336cb705d9c8d87bbaddd
[ "Apache-2.0" ]
21
2015-04-14T22:41:53.000Z
2019-02-20T09:30:10.000Z
mistral/services/scheduler.py
soda-research/mistral
550a3de9c2defc7ce26336cb705d9c8d87bbaddd
[ "Apache-2.0" ]
12
2015-08-14T02:27:37.000Z
2020-12-31T10:09:21.000Z
# Copyright 2014 - Mirantis, Inc. # Copyright 2015 - StackStorm, Inc. # Copyright 2016 - Brocade Communications Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
32.360704
79
0.610603
import copy import datetime import eventlet import random import sys import threading from oslo_config import cfg from oslo_log import log as logging from oslo_utils import importutils from mistral import context from mistral.db import utils as db_utils from mistral.db.v2 import api as db_api from mistral import exc...
true
true
1c43e8343e5b9fcf66ef7bb70fa6262538d43d26
1,366
py
Python
src/room.py
ThaDeveloper/docopt_dojo
adc09fda16a84f81776a284249615aa69ebc6861
[ "MIT" ]
null
null
null
src/room.py
ThaDeveloper/docopt_dojo
adc09fda16a84f81776a284249615aa69ebc6861
[ "MIT" ]
14
2017-11-04T09:26:08.000Z
2017-11-13T19:24:30.000Z
src/room.py
ThaDeveloper/docopt_dojo
adc09fda16a84f81776a284249615aa69ebc6861
[ "MIT" ]
null
null
null
class Room(object): ''' The Room class models the rooms in Dojo and is used as the blueprint for how the LivingSpace and OfficeSpace classes inehrit properties such as room_name,room_type and capacity.s ''' def __init__(self, room_name, room_type, capacity): self.room_type = room_ty...
31.767442
79
0.664714
class Room(object): def __init__(self, room_name, room_type, capacity): self.room_type = room_type.strip().title() self.capacity = capacity self.room_name = room_name.title() self.occupants = [] def add_person(self, person): self.occupants.append(person) self.ca...
true
true
1c43e8deb31d64389ccc2664be037b8b793fb6b7
1,425
py
Python
app/settings/migrations/0007_default_statuses.py
mandarhan/mandarhan
9ce38d10e536e0d3e2f907c3b5c560d66ccf8e40
[ "MIT" ]
null
null
null
app/settings/migrations/0007_default_statuses.py
mandarhan/mandarhan
9ce38d10e536e0d3e2f907c3b5c560d66ccf8e40
[ "MIT" ]
6
2020-02-18T03:49:09.000Z
2022-03-12T00:10:05.000Z
app/settings/migrations/0007_default_statuses.py
mandarhan/mandarhan
9ce38d10e536e0d3e2f907c3b5c560d66ccf8e40
[ "MIT" ]
1
2020-03-25T10:25:43.000Z
2020-03-25T10:25:43.000Z
from django.db import migrations DEFAULT_STATUSES = [ { 'name': 'Не подтверждено', 'color': '#ffffff', }, { 'name': 'Отменено', 'color': '#ff0000', }, { 'name': 'Подтверждено', 'color': '#daf9d3', }, { 'name': 'Выезд', 'color':...
23.360656
79
0.592281
from django.db import migrations DEFAULT_STATUSES = [ { 'name': 'Не подтверждено', 'color': '#ffffff', }, { 'name': 'Отменено', 'color': '#ff0000', }, { 'name': 'Подтверждено', 'color': '#daf9d3', }, { 'name': 'Выезд', 'color':...
true
true
1c43e93aec0b6c7b8788a78435e14115b15fa430
883
py
Python
arjuna/tpi/guiauto/source/page.py
StefanIGit/arjuna
6c7d9099e0d766e7b30936ef25d32c1414133b96
[ "Apache-2.0" ]
13
2020-05-12T06:32:51.000Z
2022-01-24T18:21:19.000Z
arjuna/tpi/guiauto/source/page.py
StefanIGit/arjuna
6c7d9099e0d766e7b30936ef25d32c1414133b96
[ "Apache-2.0" ]
5
2020-02-14T12:51:07.000Z
2021-12-01T10:39:51.000Z
arjuna/tpi/guiauto/source/page.py
StefanIGit/arjuna
6c7d9099e0d766e7b30936ef25d32c1414133b96
[ "Apache-2.0" ]
25
2020-01-16T10:44:25.000Z
2022-02-24T13:22:22.000Z
# This file is a part of Arjuna # Copyright 2015-2021 Rahul Verma # Website: www.RahulVerma.net # 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...
32.703704
74
0.745187
from arjuna.tpi.tracker import track from .base import SingleGuiEntitySource class GuiPageSource(SingleGuiEntitySource): def __init__(self, raw_source): super().__init__(raw_source)
true
true
1c43e9d6ffce0cb69156cdc14c9713e3fe44aeb5
1,048
py
Python
Crawler/crawlerpchome.py
2017HackNTU/J94FintechLa
85018fae23cff1d64f3c95c1e0f9c312dd47eade
[ "MIT" ]
null
null
null
Crawler/crawlerpchome.py
2017HackNTU/J94FintechLa
85018fae23cff1d64f3c95c1e0f9c312dd47eade
[ "MIT" ]
null
null
null
Crawler/crawlerpchome.py
2017HackNTU/J94FintechLa
85018fae23cff1d64f3c95c1e0f9c312dd47eade
[ "MIT" ]
null
null
null
import requests from selenium import webdriver from lxml import etree import re import csv import sys from selenium.webdriver.common.desired_capabilities import DesiredCapabilities # reference: http://tw.pyladies.com/~marsw/crawler02.slides.html#/3 # change to mobile website # url = sys.argv[1] # match = re.split(r'\?...
26.871795
87
0.678435
import requests from selenium import webdriver from lxml import etree import re import csv import sys from selenium.webdriver.common.desired_capabilities import DesiredCapabilities driver = webdriver.PhantomJS(executable_path=r'path_to_phantomjs/bin/phantomjs') driver.get(url) pageSource = driver.page_source driver.c...
true
true
1c43eae2870d470e535993d01691bd86de721d61
714
py
Python
example/mulit_sleep.py
zhzLuke96/Yoi
8f5a0b6881c540aab71b8a360002b4d1e9de869a
[ "MIT" ]
null
null
null
example/mulit_sleep.py
zhzLuke96/Yoi
8f5a0b6881c540aab71b8a360002b4d1e9de869a
[ "MIT" ]
null
null
null
example/mulit_sleep.py
zhzLuke96/Yoi
8f5a0b6881c540aab71b8a360002b4d1e9de869a
[ "MIT" ]
null
null
null
from yoi.application import Application import time app = Application() @app.router(r"^/sleep/(.+)/?$", methods=["GET"]) def index(request,timer): time.sleep(int(timer)) return f"server sleep {timer}s" @app.router(r"^/do/?$", methods=["GET"]) def index(): return f"server do something" if __name__ == '...
23.032258
59
0.635854
from yoi.application import Application import time app = Application() @app.router(r"^/sleep/(.+)/?$", methods=["GET"]) def index(request,timer): time.sleep(int(timer)) return f"server sleep {timer}s" @app.router(r"^/do/?$", methods=["GET"]) def index(): return f"server do something" if __name__ == '...
true
true
1c43eb9d91553b0505a12be5e48dae5a530b845e
55,590
py
Python
nitro/resource/config/ns/nsip.py
HanseMerkur/nitro-python
d03eb11f492a35a2a8b2a140322fbce22d25a8f7
[ "Apache-2.0" ]
2
2020-08-24T18:04:22.000Z
2020-08-24T18:04:47.000Z
nitro/resource/config/ns/nsip.py
HanseMerkur/nitro-python
d03eb11f492a35a2a8b2a140322fbce22d25a8f7
[ "Apache-2.0" ]
null
null
null
nitro/resource/config/ns/nsip.py
HanseMerkur/nitro-python
d03eb11f492a35a2a8b2a140322fbce22d25a8f7
[ "Apache-2.0" ]
null
null
null
# # Copyright (c) 2008-2015 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
39.792412
320
0.595215
from nitro.resource.base.base_resource import base_resource from nitro.resource.base.base_resource import base_response from nitro.service.options import options from nitro.exception.nitro_exception import nitro_exception from nitro.util.nitro_util import nitro_util class nsip(base_resource) : def __init__(self)...
true
true
1c43ec75bb5086504e75a9f3c53c197ac7943cec
27,444
py
Python
pytorch_lightning/metrics/functional/classification.py
rwbfd/pytorch-lightning
f518ee6e25d1499f73cec86ca8b3f584d0fa440d
[ "Apache-2.0" ]
null
null
null
pytorch_lightning/metrics/functional/classification.py
rwbfd/pytorch-lightning
f518ee6e25d1499f73cec86ca8b3f584d0fa440d
[ "Apache-2.0" ]
null
null
null
pytorch_lightning/metrics/functional/classification.py
rwbfd/pytorch-lightning
f518ee6e25d1499f73cec86ca8b3f584d0fa440d
[ "Apache-2.0" ]
null
null
null
# Copyright The PyTorch Lightning 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 applicable law or agreed to i...
35.411613
119
0.606872
from functools import wraps from typing import Callable, Optional, Sequence, Tuple import torch from torch.nn import functional as F from pytorch_lightning.metrics.utils import to_categorical, get_num_classes, reduce, class_reduce from pytorch_lightning.utilities import rank_zero_warn def stat_scores( pred:...
true
true
1c43ed7d220ae5c354a0880adcfe135d8c75bc34
533
py
Python
apps/discovery_pyre/setup.py
danieldUKIM/uniflex_wishrem
44ca1cfaafc33a83e856dbf9eaf9c1b83d0a477b
[ "Apache-2.0" ]
null
null
null
apps/discovery_pyre/setup.py
danieldUKIM/uniflex_wishrem
44ca1cfaafc33a83e856dbf9eaf9c1b83d0a477b
[ "Apache-2.0" ]
null
null
null
apps/discovery_pyre/setup.py
danieldUKIM/uniflex_wishrem
44ca1cfaafc33a83e856dbf9eaf9c1b83d0a477b
[ "Apache-2.0" ]
null
null
null
from setuptools import setup, find_packages def readme(): with open('README.md') as f: return f.read() setup( name='uniflex_app_discovery_pyre', version='0.1.0', packages=find_packages(), url='https://github.com/uniflex', license='', author='Piotr Gawlowicz', author_email='ga...
24.227273
69
0.679174
from setuptools import setup, find_packages def readme(): with open('README.md') as f: return f.read() setup( name='uniflex_app_discovery_pyre', version='0.1.0', packages=find_packages(), url='https://github.com/uniflex', license='', author='Piotr Gawlowicz', author_email='ga...
true
true
1c43edf8164ff697a3643279f919165a53782629
3,027
py
Python
analysis/ShowerLLH/reco-vs-true-containment.py
jrbourbeau/composition
f8debd81b0467a6094d5ba56a5f0fc6047369d30
[ "MIT" ]
null
null
null
analysis/ShowerLLH/reco-vs-true-containment.py
jrbourbeau/composition
f8debd81b0467a6094d5ba56a5f0fc6047369d30
[ "MIT" ]
7
2017-08-29T16:20:04.000Z
2018-06-12T16:58:36.000Z
analysis/ShowerLLH/reco-vs-true-containment.py
jrbourbeau/composition
f8debd81b0467a6094d5ba56a5f0fc6047369d30
[ "MIT" ]
1
2018-04-03T20:56:40.000Z
2018-04-03T20:56:40.000Z
#!/usr/bin/env python import os import sys import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LogNorm import argparse import seaborn.apionly as sns import composition.support_functions.paths as paths from composition.support_functions.checkdir import checkdir from composition.analysis.lo...
36.914634
87
0.620747
import os import sys import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LogNorm import argparse import seaborn.apionly as sns import composition.support_functions.paths as paths from composition.support_functions.checkdir import checkdir from composition.analysis.load_sim import load_sim...
true
true
1c43ef84bcf1442ec9423ec76142e69ad5abe1c0
8,496
py
Python
moto/awslambda/responses.py
kitagawa-hr/moto
97408552a323af27d9b755e5456888c496a3739d
[ "Apache-2.0" ]
1
2019-07-09T17:53:48.000Z
2019-07-09T17:53:48.000Z
moto/awslambda/responses.py
kitagawa-hr/moto
97408552a323af27d9b755e5456888c496a3739d
[ "Apache-2.0" ]
null
null
null
moto/awslambda/responses.py
kitagawa-hr/moto
97408552a323af27d9b755e5456888c496a3739d
[ "Apache-2.0" ]
1
2019-03-22T16:06:53.000Z
2019-03-22T16:06:53.000Z
from __future__ import unicode_literals import json try: from urllib import unquote except ImportError: from urllib.parse import unquote from moto.core.utils import amz_crc32, amzn_request_id, path_url from moto.core.responses import BaseResponse from .models import lambda_backends class LambdaResponse(Bas...
34.819672
103
0.608639
from __future__ import unicode_literals import json try: from urllib import unquote except ImportError: from urllib.parse import unquote from moto.core.utils import amz_crc32, amzn_request_id, path_url from moto.core.responses import BaseResponse from .models import lambda_backends class LambdaResponse(Bas...
true
true
1c43efd4690d44c896278c222e4064eae7a1c463
766
py
Python
chalicelib/filter.py
uchimanajet7/reacjilator-chalice
338daf544432f669f9bd6e78cf91d4363d6b914f
[ "MIT" ]
null
null
null
chalicelib/filter.py
uchimanajet7/reacjilator-chalice
338daf544432f669f9bd6e78cf91d4363d6b914f
[ "MIT" ]
1
2017-12-17T09:35:24.000Z
2017-12-18T01:26:54.000Z
chalicelib/filter.py
uchimanajet7/reacjilator-chalice
338daf544432f669f9bd6e78cf91d4363d6b914f
[ "MIT" ]
null
null
null
# List of channels you want to translate. import os import json class Filter: def __init__(self): self.dict_filter = self.__open_json_file__('filter.json') def __open_json_file__(self, file_name): try: dir_name = os.path.dirname(os.path.abspath(__file__)) path = os.pat...
23.9375
65
0.571802
import os import json class Filter: def __init__(self): self.dict_filter = self.__open_json_file__('filter.json') def __open_json_file__(self, file_name): try: dir_name = os.path.dirname(os.path.abspath(__file__)) path = os.path.join(dir_name, file_name) wi...
true
true
1c43f070abcedc58bf17a00a3203fb43ef6b40c7
20
py
Python
sdk/python-sdk/verity_sdk/protocols/v0_7/__init__.py
tw-bc-group/verity-sdk
e932209ab849f04a389bdda0718cd6227187e5cf
[ "Apache-2.0" ]
40
2020-07-09T01:52:31.000Z
2022-02-19T04:01:23.000Z
sdk/python-sdk/verity_sdk/protocols/v0_7/__init__.py
tw-bc-group/verity-sdk
e932209ab849f04a389bdda0718cd6227187e5cf
[ "Apache-2.0" ]
45
2020-06-19T11:00:20.000Z
2022-03-02T14:48:12.000Z
sdk/python-sdk/verity_sdk/protocols/v0_7/__init__.py
tw-bc-group/verity-sdk
e932209ab849f04a389bdda0718cd6227187e5cf
[ "Apache-2.0" ]
37
2020-06-19T10:37:04.000Z
2022-03-15T14:06:40.000Z
"""0.7 Protocols"""
10
19
0.55
true
true
1c43f09b4f119c9983b09c54d4a22142b88b1195
3,909
py
Python
pong/2_pong_singlecubebouncing.py
CrtomirJuren/pygame-projects
f710f36050bfe3ece866bbda7d570caa1e037d7a
[ "MIT" ]
null
null
null
pong/2_pong_singlecubebouncing.py
CrtomirJuren/pygame-projects
f710f36050bfe3ece866bbda7d570caa1e037d7a
[ "MIT" ]
null
null
null
pong/2_pong_singlecubebouncing.py
CrtomirJuren/pygame-projects
f710f36050bfe3ece866bbda7d570caa1e037d7a
[ "MIT" ]
null
null
null
import sys import math import random import pygame from pygame.locals import * import tkinter as tk from tkinter import messagebox clock = pygame.time.Clock() WHITE = (255,255,255) BLACK = (0,0,0) RED = (255,0,0) #--------------------------draw grid fuction---------------------------- def drawGrid(w,rows,surface): "...
27.723404
88
0.553083
import sys import math import random import pygame from pygame.locals import * import tkinter as tk from tkinter import messagebox clock = pygame.time.Clock() WHITE = (255,255,255) BLACK = (0,0,0) RED = (255,0,0) def drawGrid(w,rows,surface): sizeBtwn = w // rows x = 0 y = 0 for l in range(rows): x = x + siz...
true
true
1c43f0cb68057fe546f78196c9cc49dd1da135d3
6,696
py
Python
source/minefield.py
BastiHz/Minefields
46bb66cb3a809f6d21d7811e9a7df214be044fbd
[ "MIT" ]
1
2021-02-22T15:32:31.000Z
2021-02-22T15:32:31.000Z
source/minefield.py
BastiHz/Minefields
46bb66cb3a809f6d21d7811e9a7df214be044fbd
[ "MIT" ]
null
null
null
source/minefield.py
BastiHz/Minefields
46bb66cb3a809f6d21d7811e9a7df214be044fbd
[ "MIT" ]
null
null
null
import random import pygame as pg import prepare class Minefield: def __init__(self, width, height, number_of_mines): self.width = width self.height = height self.num_mines = number_of_mines self.tiles = prepare.minefield_tiles self.tile_size = prepare.MINEFIELD_TILE_SIZ...
39.621302
80
0.538082
import random import pygame as pg import prepare class Minefield: def __init__(self, width, height, number_of_mines): self.width = width self.height = height self.num_mines = number_of_mines self.tiles = prepare.minefield_tiles self.tile_size = prepare.MINEFIELD_TILE_SIZ...
true
true
1c43f0d5386fd740efb998b838ef3980fb5d15bf
7,728
py
Python
torchreid/models/squeezenet.py
qw85639229/hardest
ef86536dbbe1089248e34afbbb7bb513f97f58f1
[ "MIT" ]
21
2020-10-13T01:33:31.000Z
2022-01-04T15:58:31.000Z
torchreid/models/squeezenet.py
qw85639229/hardest
ef86536dbbe1089248e34afbbb7bb513f97f58f1
[ "MIT" ]
10
2020-11-18T07:40:22.000Z
2021-10-05T07:58:25.000Z
torchreid/models/squeezenet.py
qw85639229/hardest
ef86536dbbe1089248e34afbbb7bb513f97f58f1
[ "MIT" ]
7
2020-11-19T08:40:27.000Z
2022-02-05T06:24:08.000Z
""" Code source: https://github.com/pytorch/vision """ from __future__ import absolute_import from __future__ import division __all__ = [ 'squeezenet1_0', 'squeezenet1_1', 'squeezenet1_0_fc512' ] from collections import OrderedDict import math import torch import torch.nn as nn from torch.utils import mo...
33.454545
123
0.583075
from __future__ import absolute_import from __future__ import division __all__ = [ 'squeezenet1_0', 'squeezenet1_1', 'squeezenet1_0_fc512' ] from collections import OrderedDict import math import torch import torch.nn as nn from torch.utils import model_zoo from torch.nn import functional as F import tor...
true
true
1c43f0f37d381ccc50b76c9a1eb0cc96c6d62613
10,065
py
Python
DPDNet/image_to_patch_filter.py
Abdullah-Abuolaim/defocus-deblurring-dual-pixel
21a43e7d12350c62c4038485cdeebc27a078765b
[ "MIT" ]
115
2020-05-01T22:51:14.000Z
2022-03-12T13:18:37.000Z
DPDNet/image_to_patch_filter.py
panpanfei/defocus-deblurring-dual-pixel
8c1b812236d2eb3293b670512ef35e20471e2e48
[ "MIT" ]
14
2020-05-12T03:38:57.000Z
2021-06-01T15:02:04.000Z
DPDNet/image_to_patch_filter.py
Abdullah-Abuolaim/defocus-deblurring-dual-pixel
21a43e7d12350c62c4038485cdeebc27a078765b
[ "MIT" ]
13
2020-06-28T08:25:09.000Z
2022-02-28T16:10:46.000Z
""" This code is used to extract image patches from the training and validation sets as described in the paper. For the training set patches, we discard 30% of the patches that have the lowest sharpness energy. Recall that we don't extract patches for test images because we process full image at test time. Copyright (...
56.544944
187
0.719424
import numpy as np import os import cv2 import errno from copy import deepcopy def check_create_directory(path_to_check): if not os.path.exists(path_to_check): try: os.makedirs(path_to_check) except OSError as exc: if exc.errno != errno.EEXIST: raise def sh...
true
true
1c43f2f1279c5e8aee0def23c69b53b4bb131a33
556
py
Python
examples/server/asgi/simple.py
13g10n/python-engineio
e882f5949bdd1618d97b0cade18a7e8af8670b41
[ "MIT" ]
208
2015-06-22T00:44:53.000Z
2022-02-13T16:39:14.000Z
examples/server/asgi/simple.py
13g10n/python-engineio
e882f5949bdd1618d97b0cade18a7e8af8670b41
[ "MIT" ]
241
2015-08-12T06:15:40.000Z
2022-03-18T19:17:46.000Z
examples/server/asgi/simple.py
13g10n/python-engineio
e882f5949bdd1618d97b0cade18a7e8af8670b41
[ "MIT" ]
153
2015-08-08T15:40:45.000Z
2022-03-29T14:26:32.000Z
import os import uvicorn import engineio eio = engineio.AsyncServer(async_mode='asgi') app = engineio.ASGIApp(eio, static_files={ '/': 'simple.html', '/static': 'static', }) @eio.on('connect') def connect(sid, environ): print("connect ", sid) @eio.on('message') async def message(sid, data): print(...
17.935484
54
0.656475
import os import uvicorn import engineio eio = engineio.AsyncServer(async_mode='asgi') app = engineio.ASGIApp(eio, static_files={ '/': 'simple.html', '/static': 'static', }) @eio.on('connect') def connect(sid, environ): print("connect ", sid) @eio.on('message') async def message(sid, data): print(...
true
true
1c43f3b270474db102bfa0c81625d0a5e1cecaa3
2,053
py
Python
budgetportal/tests/test_guides_pages.py
TomaszKolek/datamanager
d46dbab00e30a14fc26eb9368c32dcdbbda7309d
[ "MIT" ]
null
null
null
budgetportal/tests/test_guides_pages.py
TomaszKolek/datamanager
d46dbab00e30a14fc26eb9368c32dcdbbda7309d
[ "MIT" ]
null
null
null
budgetportal/tests/test_guides_pages.py
TomaszKolek/datamanager
d46dbab00e30a14fc26eb9368c32dcdbbda7309d
[ "MIT" ]
null
null
null
from django.core.files.images import ImageFile from django.test import Client, TestCase from budgetportal.models import GuideIndexPage, GuidePage, CategoryGuide class GuideIndexPageTestCase(TestCase): fixtures = ["test-guides-pages"] def setUp(self): self.guide_index_page = GuideIndexPage.objects.get...
40.254902
97
0.702874
from django.core.files.images import ImageFile from django.test import Client, TestCase from budgetportal.models import GuideIndexPage, GuidePage, CategoryGuide class GuideIndexPageTestCase(TestCase): fixtures = ["test-guides-pages"] def setUp(self): self.guide_index_page = GuideIndexPage.objects.get...
true
true
1c43f415944cc54adda6eed157b9ba14a13830c1
948
py
Python
lupdate_xml.py
Skycoder42/QtMvvmSettingsCore
4489151d3e7de940790c5a93041c7381799f695a
[ "BSD-3-Clause" ]
null
null
null
lupdate_xml.py
Skycoder42/QtMvvmSettingsCore
4489151d3e7de940790c5a93041c7381799f695a
[ "BSD-3-Clause" ]
null
null
null
lupdate_xml.py
Skycoder42/QtMvvmSettingsCore
4489151d3e7de940790c5a93041c7381799f695a
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python3 # Usage: lupdate_xml.py bindir srcdir locales(space seperated) xml_sources... import sys import os import subprocess from xml.etree.ElementTree import Element, parse bindir = sys.argv[1] srcdir = sys.argv[2] srces = sys.argv[3:] os.chdir(srcdir) tsmap = {} for src in srces: trstrings = set()...
23.7
84
0.690928
import sys import os import subprocess from xml.etree.ElementTree import Element, parse bindir = sys.argv[1] srcdir = sys.argv[2] srces = sys.argv[3:] os.chdir(srcdir) tsmap = {} for src in srces: trstrings = set() tree = parse(src) root = Element("TS") for elem in tree.iter(): if elem.tag == "SearchKey": ...
true
true
1c43f45217488b9d1f345b843dcd9e4b6f84640c
990
py
Python
6.py
andy0130tw/advent-of-code-2019
aeaeb50db3170e619aef41756ce0608793a64baa
[ "Unlicense" ]
null
null
null
6.py
andy0130tw/advent-of-code-2019
aeaeb50db3170e619aef41756ce0608793a64baa
[ "Unlicense" ]
null
null
null
6.py
andy0130tw/advent-of-code-2019
aeaeb50db3170e619aef41756ce0608793a64baa
[ "Unlicense" ]
null
null
null
def rec_sum(root, depth): ans = depth for el in root.values(): ans += rec_sum(el, depth + 1) return ans def find_path(root, target): for lab, sub in root.items(): if lab == target: return [lab] res = find_path(sub, target) if res: return [lab, *...
19.038462
49
0.489899
def rec_sum(root, depth): ans = depth for el in root.values(): ans += rec_sum(el, depth + 1) return ans def find_path(root, target): for lab, sub in root.items(): if lab == target: return [lab] res = find_path(sub, target) if res: return [lab, *...
true
true
1c43f58337d7879e5d18e9e1149c4866747fbd4d
926
py
Python
src/partition_set_into_equal_sum.py
redfast00/daily-algorithm-challenge
3507164d5ec58abe68a6e820120625e100dee96c
[ "MIT" ]
null
null
null
src/partition_set_into_equal_sum.py
redfast00/daily-algorithm-challenge
3507164d5ec58abe68a6e820120625e100dee96c
[ "MIT" ]
null
null
null
src/partition_set_into_equal_sum.py
redfast00/daily-algorithm-challenge
3507164d5ec58abe68a6e820120625e100dee96c
[ "MIT" ]
null
null
null
from collections import Counter from get_subset_sum import subset_sum def partition_into_equal_parts(l): '''Partitions s into two subsets of l that have the same sum. >>> problem = [15, 5, 20, 10, 35, 25, 10] >>> first, second = partition_into_equal_parts(problem) >>> valid_solution(first, second, pr...
30.866667
93
0.654428
from collections import Counter from get_subset_sum import subset_sum def partition_into_equal_parts(l): total = sum(l) if total % 2: return first = subset_sum(total // 2, l) if first is None: return second = [] second_counter = Counter(l) - Counter(first) for numbe...
true
true
1c43f593ad0ffdb5320aa7b3fb8d314b549d0517
1,804
py
Python
colorize_sky.py
kcotar/Stellar_abudance_trees
1a4377ef53a4b4c8df1be860598a70be31626110
[ "MIT" ]
null
null
null
colorize_sky.py
kcotar/Stellar_abudance_trees
1a4377ef53a4b4c8df1be860598a70be31626110
[ "MIT" ]
null
null
null
colorize_sky.py
kcotar/Stellar_abudance_trees
1a4377ef53a4b4c8df1be860598a70be31626110
[ "MIT" ]
null
null
null
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap def _prepare_ra_dec(data): ra = data['ra'] idx_trans = ra > 180 if len(idx_trans) > 0: ra[idx_trans] -= 360 ra = np.deg2rad(ra) dec = np.deg2rad(data['dec']) return ra, dec def plot_ra_dec_loc...
30.066667
73
0.616962
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap def _prepare_ra_dec(data): ra = data['ra'] idx_trans = ra > 180 if len(idx_trans) > 0: ra[idx_trans] -= 360 ra = np.deg2rad(ra) dec = np.deg2rad(data['dec']) return ra, dec def plot_ra_dec_loc...
true
true
1c43f730fff18adef3c514b8dfe4a98cff45a408
4,124
py
Python
test/coreneuron/test_spikes.py
ishandutta2007/nrn
418d42fb7afc0ebb06138b80e511c8ae716dcad0
[ "BSD-3-Clause" ]
null
null
null
test/coreneuron/test_spikes.py
ishandutta2007/nrn
418d42fb7afc0ebb06138b80e511c8ae716dcad0
[ "BSD-3-Clause" ]
null
null
null
test/coreneuron/test_spikes.py
ishandutta2007/nrn
418d42fb7afc0ebb06138b80e511c8ae716dcad0
[ "BSD-3-Clause" ]
null
null
null
import distutils.util import os import sys # Hacky, but it's non-trivial to pass commandline arguments to pytest tests. enable_gpu = bool( distutils.util.strtobool(os.environ.get("CORENRN_ENABLE_GPU", "false")) ) mpi4py_option = bool( distutils.util.strtobool(os.environ.get("NRN_TEST_SPIKES_MPI4PY", "false")) ...
26.606452
87
0.629243
import distutils.util import os import sys enable_gpu = bool( distutils.util.strtobool(os.environ.get("CORENRN_ENABLE_GPU", "false")) ) mpi4py_option = bool( distutils.util.strtobool(os.environ.get("NRN_TEST_SPIKES_MPI4PY", "false")) ) file_mode_option = bool( distutils.util.strtobool(os.environ.get("NRN_T...
true
true
1c43f74e70b164c0121e3a9b4edda8f51bbb7dec
984
py
Python
python_Project/Day_16-20/Day_16-20_Sort&Search_Algorithms/Cocktail_sort.py
Zzz-ww/Python-prac
c97f2c16b74a2c1df117f377a072811cc596f98b
[ "MIT" ]
null
null
null
python_Project/Day_16-20/Day_16-20_Sort&Search_Algorithms/Cocktail_sort.py
Zzz-ww/Python-prac
c97f2c16b74a2c1df117f377a072811cc596f98b
[ "MIT" ]
null
null
null
python_Project/Day_16-20/Day_16-20_Sort&Search_Algorithms/Cocktail_sort.py
Zzz-ww/Python-prac
c97f2c16b74a2c1df117f377a072811cc596f98b
[ "MIT" ]
null
null
null
""" 双向冒泡: 冒泡排序,每次都是从左往右,交换相邻的元素,从而达到循环一边可以把最大的元素放在右边。 而双向冒泡排序,在完成一次从左往右的冒泡排序后,再从右往左进行冒泡,从而把小的元素放在左边。 下面这张图可以很好地表达: """ def bubble_sort(origin_items): """高质量冒泡排序(搅拌排序)/双向冒泡排序""" comp = lambda x, y: x > y items = origin_items[:] for i in range(len(items) - 1): swapped = False # 这个标志位也是可以放到简单冒...
27.333333
73
0.530488
def bubble_sort(origin_items): comp = lambda x, y: x > y items = origin_items[:] for i in range(len(items) - 1): swapped = False for j in range(i, len(items) - 1 - i): if comp(items[j], items[j + 1]): items[j], items[j + 1] = items[j + 1], items[j] ...
true
true
1c43f7cc88953082721b55d83771cbbd3042f65b
1,154
py
Python
check_generated_geometry.py
hyuanmech/MOPSO
f2cbe9151d9dbd21b562957b368f22e2648232b9
[ "MIT" ]
null
null
null
check_generated_geometry.py
hyuanmech/MOPSO
f2cbe9151d9dbd21b562957b368f22e2648232b9
[ "MIT" ]
null
null
null
check_generated_geometry.py
hyuanmech/MOPSO
f2cbe9151d9dbd21b562957b368f22e2648232b9
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Mon Mar 23 16:05:17 2020 @author: yuanh """ import os import shutil from openpyxl import load_workbook import numpy as np it = 6 flag = 0 nPop = 100 if flag == 1: n = 9 index = np.zeros((n, 1)) wb = load_workbook('Positions.xlsx') sheet ...
28.85
146
0.587522
import os import shutil from openpyxl import load_workbook import numpy as np it = 6 flag = 0 nPop = 100 if flag == 1: n = 9 index = np.zeros((n, 1)) wb = load_workbook('Positions.xlsx') sheet = wb['2_mu'] for i in range(n): index[i,0] = sheet.cell(row=i+2,column=1).va...
true
true
1c43fa14320229168e0e657e1dda3761504a32b4
992
py
Python
guillotina/tests/test_middlewares.py
psanlorenzo/guillotina
0840cf39914d23a9e26e35bd40939511d3ca78d7
[ "BSD-2-Clause" ]
null
null
null
guillotina/tests/test_middlewares.py
psanlorenzo/guillotina
0840cf39914d23a9e26e35bd40939511d3ca78d7
[ "BSD-2-Clause" ]
null
null
null
guillotina/tests/test_middlewares.py
psanlorenzo/guillotina
0840cf39914d23a9e26e35bd40939511d3ca78d7
[ "BSD-2-Clause" ]
null
null
null
import asyncio import pytest import time class AsgiMiddlewate: def __init__(self, app): self.next_app = app async def __call__(self, scope, receive, send): start = time.time() await asyncio.sleep(0.1) response = await self.next_app(scope, receive, send) end = time.time...
31
96
0.633065
import asyncio import pytest import time class AsgiMiddlewate: def __init__(self, app): self.next_app = app async def __call__(self, scope, receive, send): start = time.time() await asyncio.sleep(0.1) response = await self.next_app(scope, receive, send) end = time.time...
true
true
1c43fa71bbb82846c555d0bca310adf074f93a62
2,024
py
Python
third_party/tests/Opentitan/util/tlgen/item.py
parzival3/Surelog
cf126533ebfb2af7df321057af9e3535feb30487
[ "Apache-2.0" ]
156
2019-11-16T17:29:55.000Z
2022-01-21T05:41:13.000Z
third_party/tests/Opentitan/util/tlgen/item.py
parzival3/Surelog
cf126533ebfb2af7df321057af9e3535feb30487
[ "Apache-2.0" ]
414
2021-06-11T07:22:01.000Z
2022-03-31T22:06:14.000Z
third_party/tests/Opentitan/util/tlgen/item.py
parzival3/Surelog
cf126533ebfb2af7df321057af9e3535feb30487
[ "Apache-2.0" ]
30
2019-11-18T16:31:40.000Z
2021-12-26T01:22:51.000Z
# Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 from enum import Enum class Edge: """Edge class contains the connection from a node to a node. a Node can be a host port, output of async_fifo, port in a socket,...
26.986667
74
0.630929
from enum import Enum class Edge: def __init__(self, us, ds): self.us = us self.ds = ds def __repr__(self): return "U(%s) D(%s)" % (self.us.name, self.ds.name) class NodeType(Enum): HOST = 1 DEVICE = 2 ASYNC_FIFO = 3 SOCKET_1N = 4 SOCKET_M1 = 5 class Node: ...
true
true
1c43fba068f52e1707fd9f7186978e03b366e299
1,960
py
Python
cli/tests/test_cli.py
SophieHerbst/mne-bids
0e9b5e261668b90efec28359772f321d999af7d7
[ "BSD-3-Clause" ]
null
null
null
cli/tests/test_cli.py
SophieHerbst/mne-bids
0e9b5e261668b90efec28359772f321d999af7d7
[ "BSD-3-Clause" ]
null
null
null
cli/tests/test_cli.py
SophieHerbst/mne-bids
0e9b5e261668b90efec28359772f321d999af7d7
[ "BSD-3-Clause" ]
null
null
null
"""Test command line.""" # Authors: Teon L Brooks <teon.brooks@gmail.com> # Stefan Appelhoff <stefan.appelhoff@mailbox.org> # # License: BSD (3-clause) from os import path as op import pytest import mne from mne.datasets import testing from mne.utils import run_tests_if_main, ArgvSetter from cli import mne_b...
27.222222
73
0.642347
from os import path as op import pytest import mne from mne.datasets import testing from mne.utils import run_tests_if_main, ArgvSetter from cli import mne_bids_raw_to_bids, mne_bids_cp base_path = op.join(op.dirname(mne.__file__), 'io') subject_id = '01' task = 'testing' def check_usage(module, force_help=False):...
true
true
1c43fc03ab33ea2e19164c0644663693552fe20d
17,011
py
Python
opics/utils.py
jaspreetj/opics
037ed93ad9f6c9ad9fec5feb214bb89de24635f0
[ "MIT" ]
null
null
null
opics/utils.py
jaspreetj/opics
037ed93ad9f6c9ad9fec5feb214bb89de24635f0
[ "MIT" ]
null
null
null
opics/utils.py
jaspreetj/opics
037ed93ad9f6c9ad9fec5feb214bb89de24635f0
[ "MIT" ]
null
null
null
from typing import Any, Dict, List, Tuple import cmath as cm import time import re import itertools import inspect from copy import deepcopy import numpy as np from numpy import ndarray from pathlib import PosixPath from defusedxml.ElementTree import parse def fromSI(value: str) -> float: """converts from SI unit...
35.146694
141
0.479043
from typing import Any, Dict, List, Tuple import cmath as cm import time import re import itertools import inspect from copy import deepcopy import numpy as np from numpy import ndarray from pathlib import PosixPath from defusedxml.ElementTree import parse def fromSI(value: str) -> float: return float(value.repla...
true
true
1c43fd68b8e8426feafb7efe2b494da8cef3208e
16,870
py
Python
django_extensions/management/modelviz.py
echirchir/django-extensions
ae38e33309b87bf7431bc5f1321699f5d00a0431
[ "MIT" ]
null
null
null
django_extensions/management/modelviz.py
echirchir/django-extensions
ae38e33309b87bf7431bc5f1321699f5d00a0431
[ "MIT" ]
null
null
null
django_extensions/management/modelviz.py
echirchir/django-extensions
ae38e33309b87bf7431bc5f1321699f5d00a0431
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ modelviz.py - DOT file generator for Django Models Based on: Django model to DOT (Graphviz) converter by Antonio Cavedoni <antonio@cavedoni.org> Adapted to be used with django-extensions """ import datetime import os import re import six from django.apps import apps from django.db.m...
38.960739
142
0.605809
import datetime import os import re import six from django.apps import apps from django.db.models.fields.related import ( ForeignKey, ManyToManyField, OneToOneField, RelatedField, ) from django.contrib.contenttypes.fields import GenericRelation from django.template import Context, Template, loader from django.uti...
true
true
1c43fdcc16345073c0458921b47d255ef287bd2e
103
py
Python
edag/cli/__init__.py
sodre/edag-cli
f1f88fd749b3e8a94c93afa6ae78e8cb5fc84436
[ "BSD-3-Clause" ]
null
null
null
edag/cli/__init__.py
sodre/edag-cli
f1f88fd749b3e8a94c93afa6ae78e8cb5fc84436
[ "BSD-3-Clause" ]
4
2019-12-13T05:35:15.000Z
2019-12-30T21:07:14.000Z
edag/cli/__init__.py
sodre/edag-cli
f1f88fd749b3e8a94c93afa6ae78e8cb5fc84436
[ "BSD-3-Clause" ]
null
null
null
"""Top-level package for ElasticDAG CLI.""" from ._version import version as __version__ # noqa: F401
34.333333
58
0.747573
from ._version import version as __version__
true
true
1c43fe5c5576e93119229d732edb22ae2f787b24
8,554
py
Python
applications/systems_of_equations_ex2/script/exodus_data_extraction.py
ElsevierSoftwareX/SOFTX_2019_102
123c4b3988ef2fb86b49a247b8431dc94a89eded
[ "MIT" ]
null
null
null
applications/systems_of_equations_ex2/script/exodus_data_extraction.py
ElsevierSoftwareX/SOFTX_2019_102
123c4b3988ef2fb86b49a247b8431dc94a89eded
[ "MIT" ]
null
null
null
applications/systems_of_equations_ex2/script/exodus_data_extraction.py
ElsevierSoftwareX/SOFTX_2019_102
123c4b3988ef2fb86b49a247b8431dc94a89eded
[ "MIT" ]
null
null
null
import sys, os #### import the simple module from the paraview from paraview.simple import * if __name__ == "__main__" and len(sys.argv) > 1: time_step = int(sys.argv[1]) #### disable automatic camera reset on 'Show' paraview.simple._DisableFirstRenderCameraReset() # create a new 'ExodusIIReader' ...
49.445087
452
0.655483
import sys, os from paraview.simple import * if __name__ == "__main__" and len(sys.argv) > 1: time_step = int(sys.argv[1]) paraview.simple._DisableFirstRenderCameraReset() oute = ExodusIIReader(FileName=['./out.e']) timestep_values = oute.TimestepValues oute.PointVariables = [] oute.S...
true
true
1c43fefda8a6cb0284260eadeb99ad911c49bee5
3,177
py
Python
gala/potential/potential/builtin/pybuiltin.py
akeemlh/gala
0fdaf9159bccc59af2a3525f2926e04501754f48
[ "MIT" ]
null
null
null
gala/potential/potential/builtin/pybuiltin.py
akeemlh/gala
0fdaf9159bccc59af2a3525f2926e04501754f48
[ "MIT" ]
null
null
null
gala/potential/potential/builtin/pybuiltin.py
akeemlh/gala
0fdaf9159bccc59af2a3525f2926e04501754f48
[ "MIT" ]
null
null
null
# Third-party import numpy as np from gala.potential.potential.core import PotentialBase from gala.potential.potential.util import sympy_wrap from gala.potential.common import PotentialParameter __all__ = ["HarmonicOscillatorPotential"] class HarmonicOscillatorPotential(PotentialBase): r""" Represents an N-...
34.912088
89
0.639597
import numpy as np from gala.potential.potential.core import PotentialBase from gala.potential.potential.util import sympy_wrap from gala.potential.common import PotentialParameter __all__ = ["HarmonicOscillatorPotential"] class HarmonicOscillatorPotential(PotentialBase): omega = PotentialParameter('omega', phy...
true
true
1c43ff06f66ece3c7d95b1983fde0993f787cb7e
2,428
py
Python
swaps/utils/channels.py
DunnCreativeSS/cash_carry_leveraged_futures_arbitrageur
1120ebfb487ce4987fe70e6645b36e0d7ce041ec
[ "Apache-2.0" ]
1
2021-09-06T00:09:11.000Z
2021-09-06T00:09:11.000Z
swaps/utils/channels.py
DunnCreativeSS/cash_carry_leveraged_futures_arbitrageur
1120ebfb487ce4987fe70e6645b36e0d7ce041ec
[ "Apache-2.0" ]
null
null
null
swaps/utils/channels.py
DunnCreativeSS/cash_carry_leveraged_futures_arbitrageur
1120ebfb487ce4987fe70e6645b36e0d7ce041ec
[ "Apache-2.0" ]
null
null
null
import json from swaps.utils.time_service import get_current_timestamp from swaps.constant import DepthStep def kline_channel(symbol, interval): channel = dict() channel["sub"] = "market." + symbol + ".kline." + interval channel["id"] = str(get_current_timestamp()) return json.dumps(channel) def tra...
28.904762
96
0.670511
import json from swaps.utils.time_service import get_current_timestamp from swaps.constant import DepthStep def kline_channel(symbol, interval): channel = dict() channel["sub"] = "market." + symbol + ".kline." + interval channel["id"] = str(get_current_timestamp()) return json.dumps(channel) def tra...
true
true
1c43ff8b50f9f4dccea00f66a1b714b913f672b2
4,157
py
Python
speech_activity_detection/sad.py
hlt-bme-hu/hunspeech
b8599e232ed2daa6ff6e07b92c6dca003b8c4bde
[ "MIT" ]
17
2017-03-05T03:19:37.000Z
2020-07-28T03:05:55.000Z
speech_activity_detection/sad.py
hlt-bme-hu/hunspeech
b8599e232ed2daa6ff6e07b92c6dca003b8c4bde
[ "MIT" ]
7
2016-07-05T08:40:15.000Z
2016-07-28T10:07:38.000Z
speech_activity_detection/sad.py
hlt-bme-hu/hunspeech
b8599e232ed2daa6ff6e07b92c6dca003b8c4bde
[ "MIT" ]
6
2017-05-10T12:27:35.000Z
2018-09-14T20:13:43.000Z
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright © 2016 Judit Acs <judit@sch.bme.hu> # # Distributed under terms of the GPL license. from argparse import ArgumentParser import os import subprocess class EMSpeechActicityDetection: """Speech activity detection and segmentation This class is a wrapp...
35.836207
76
0.600674
from argparse import ArgumentParser import os import subprocess class EMSpeechActicityDetection: def __init__(self, filename, model=None, segment_out='segments.txt', segment_dir=None, shout_path=os.environ.get('SHOUT_DIR')): self.filename = filename if model is None: ...
true
true
1c4400536ce84830b6a1ec7c250cf1e8cccf83e5
3,961
py
Python
tensorflow_probability/python/mcmc/internal/leapfrog_integrator_test.py
NeelGhoshal/probability
45ed841e3cff6cdc7cd1b2d96dd874d9070318f7
[ "Apache-2.0" ]
2
2019-10-30T04:45:07.000Z
2019-10-30T04:45:08.000Z
tensorflow_probability/python/mcmc/internal/leapfrog_integrator_test.py
gregorystrubel/probability
df96f3d56eff92c6b06fbac68dc58e095e28fed6
[ "Apache-2.0" ]
null
null
null
tensorflow_probability/python/mcmc/internal/leapfrog_integrator_test.py
gregorystrubel/probability
df96f3d56eff92c6b06fbac68dc58e095e28fed6
[ "Apache-2.0" ]
null
null
null
# Copyright 2018 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
35.053097
92
0.721283
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow.compat.v1 as tf1 import tensorflow.compat.v2 as tf from tensorflow_probability.python.internal import test_util from tensorflow_probability.python.mcmc.internal import lea...
true
true
1c4401781e653e88d9e6d6f9fbced6b590f8d769
243
py
Python
example/envless_mode/app.py
jhesketh/dynaconf
a8038b87763ae8e790ff7e745b9335f997d5bd16
[ "MIT" ]
1
2021-07-21T17:06:16.000Z
2021-07-21T17:06:16.000Z
example/envless_mode/app.py
jhesketh/dynaconf
a8038b87763ae8e790ff7e745b9335f997d5bd16
[ "MIT" ]
null
null
null
example/envless_mode/app.py
jhesketh/dynaconf
a8038b87763ae8e790ff7e745b9335f997d5bd16
[ "MIT" ]
null
null
null
import os from dynaconf import LazySettings settings = LazySettings(ENVLESS_MODE=True) assert settings.FOO == "bar" assert settings.HELLO == "world" assert settings.DATABASES.default.port == 8080 assert settings.LAZY == os.environ["HOME"]
20.25
46
0.769547
import os from dynaconf import LazySettings settings = LazySettings(ENVLESS_MODE=True) assert settings.FOO == "bar" assert settings.HELLO == "world" assert settings.DATABASES.default.port == 8080 assert settings.LAZY == os.environ["HOME"]
true
true
1c4403bd35f001ff67a9f8496dba9393ab34b2fe
5,177
py
Python
pineboolib/kugar/mreportobject.py
Miguel-J/pineboo-buscar
41a2f3ee0425d163619b78f32544c4b4661d5fa7
[ "MIT" ]
null
null
null
pineboolib/kugar/mreportobject.py
Miguel-J/pineboo-buscar
41a2f3ee0425d163619b78f32544c4b4661d5fa7
[ "MIT" ]
null
null
null
pineboolib/kugar/mreportobject.py
Miguel-J/pineboo-buscar
41a2f3ee0425d163619b78f32544c4b4661d5fa7
[ "MIT" ]
null
null
null
from enum import Enum from PyQt5 import QtGui from PyQt5.QtCore import Qt from PyQt5.Qt import QObject from pineboolib import decorators from pineboolib.flcontrols import ProjectClass from pineboolib.fllegacy.FLStylePainter import FLStylePainter class MReportObject(ProjectClass, QObject): class BorderStyle(En...
26.548718
76
0.615414
from enum import Enum from PyQt5 import QtGui from PyQt5.QtCore import Qt from PyQt5.Qt import QObject from pineboolib import decorators from pineboolib.flcontrols import ProjectClass from pineboolib.fllegacy.FLStylePainter import FLStylePainter class MReportObject(ProjectClass, QObject): class BorderStyle(En...
true
true
1c440499d9570cd84e8b5504049bea924a674c85
2,985
py
Python
deepxde/geometry/geometry_3d.py
mitchelldaneker/deepxde
62e09b62ceaab6bda2ebbd02dc30ad99c2990302
[ "Apache-2.0" ]
955
2019-06-21T21:56:02.000Z
2022-03-31T03:44:45.000Z
deepxde/geometry/geometry_3d.py
mitchelldaneker/deepxde
62e09b62ceaab6bda2ebbd02dc30ad99c2990302
[ "Apache-2.0" ]
517
2019-07-25T16:47:44.000Z
2022-03-31T17:37:58.000Z
deepxde/geometry/geometry_3d.py
mitchelldaneker/deepxde
62e09b62ceaab6bda2ebbd02dc30ad99c2990302
[ "Apache-2.0" ]
374
2019-06-24T00:44:16.000Z
2022-03-30T08:17:36.000Z
from __future__ import absolute_import from __future__ import division from __future__ import print_function import itertools import numpy as np from .geometry_2d import Rectangle from .geometry_nd import Hypercube, Hypersphere class Cuboid(Hypercube): """ Args: xmin: Coordinate of bottom left corn...
35.963855
85
0.540369
from __future__ import absolute_import from __future__ import division from __future__ import print_function import itertools import numpy as np from .geometry_2d import Rectangle from .geometry_nd import Hypercube, Hypersphere class Cuboid(Hypercube): def __init__(self, xmin, xmax): super(Cuboid, sel...
true
true
1c44054209fde45c023c2b56668fd3ef83696358
5,515
py
Python
src_py/rlpytorch/trainer/utils.py
r-woo/elfai
2c37625e608e7720b8bd7847419d7b53e87e260a
[ "BSD-3-Clause" ]
3,305
2018-05-02T17:41:36.000Z
2022-03-28T05:57:56.000Z
src_py/rlpytorch/trainer/utils.py
r-woo/elfai
2c37625e608e7720b8bd7847419d7b53e87e260a
[ "BSD-3-Clause" ]
135
2018-05-02T19:25:13.000Z
2020-08-20T02:39:14.000Z
src_py/rlpytorch/trainer/utils.py
r-woo/elfai
2c37625e608e7720b8bd7847419d7b53e87e260a
[ "BSD-3-Clause" ]
604
2018-05-02T19:38:45.000Z
2022-03-18T10:01:57.000Z
# Copyright (c) 2018-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import os from collections import defaultdict, deque, Counter from datetime import datetime from elf.options import au...
30.469613
78
0.558114
import os from collections import defaultdict, deque, Counter from datetime import datetime from elf.options import auto_import_options, PyOptionSpec class SymLink(object): def __init__(self, sym_prefix, latest_k=5): self.sym_prefix = sym_prefix self.latest_k = latest_k self.latest_files...
true
true
1c44057063242c94c41dd5976ac9aa98bd752b8e
956
py
Python
devel/test_forward_all.py
saidbakr/darkhttpd
cb548aef6ded6794b2a5bee06f40ec1ce415baad
[ "ISC" ]
788
2021-01-23T03:58:42.000Z
2022-03-28T12:32:35.000Z
devel/test_forward_all.py
saidbakr/darkhttpd
cb548aef6ded6794b2a5bee06f40ec1ce415baad
[ "ISC" ]
18
2021-02-15T06:31:17.000Z
2022-03-10T21:46:47.000Z
devel/test_forward_all.py
saidbakr/darkhttpd
cb548aef6ded6794b2a5bee06f40ec1ce415baad
[ "ISC" ]
59
2021-01-23T10:10:15.000Z
2022-03-25T13:50:16.000Z
#!/usr/bin/env python3 # This is run by the "run-tests" script. import unittest from test import TestHelper, Conn, parse class TestForwardAll(TestHelper): def test_forward_root(self): resp = self.get('/', req_hdrs={'Host': 'not-example.com'}) status, hdrs, body = parse(resp) self.assertCont...
34.142857
66
0.643305
import unittest from test import TestHelper, Conn, parse class TestForwardAll(TestHelper): def test_forward_root(self): resp = self.get('/', req_hdrs={'Host': 'not-example.com'}) status, hdrs, body = parse(resp) self.assertContains(status, "301 Moved Permanently") expect = "http://c...
true
true
1c4405dd71703bf265606d16a607178206d20790
5,053
py
Python
model/flops.py
JACKYLUO1991/Face-skin-hair-segmentaiton-and-skin-color-evaluation
de2375dc0ebff03b8ac39c8a16dee427838c8ac4
[ "Apache-2.0" ]
152
2020-01-02T01:27:50.000Z
2022-03-23T16:40:01.000Z
model/flops.py
JACKYLUO1991/Face-skin-hair-segmentaiton-and-skin-color-evaluation
de2375dc0ebff03b8ac39c8a16dee427838c8ac4
[ "Apache-2.0" ]
10
2020-01-03T07:29:59.000Z
2021-12-11T10:57:30.000Z
model/flops.py
JACKYLUO1991/Face-skin-hair-segmentaiton-and-skin-color-evaluation
de2375dc0ebff03b8ac39c8a16dee427838c8ac4
[ "Apache-2.0" ]
40
2020-01-03T00:41:49.000Z
2021-11-23T11:44:07.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2020/3/27 17:49 # @Author : JackyLUO # @E-mail : lingluo@stumail.neu.edu.cn # @Site : # @File : flops.py # @Software: PyCharm # https://github.com/ckyrkou/Keras_FLOP_Estimator import keras.backend as K def get_flops(model, table=False): if table...
34.141892
106
0.493766
import keras.backend as K def get_flops(model, table=False): if table: print('%25s | %16s | %16s | %16s | %16s | %6s | %6s' % ( 'Layer Name', 'Input Shape', 'Output Shape', 'Kernel Size', 'Filters', 'Strides', 'FLOPS')) print('-' * 170) t_flops = 0 t_macc = 0 for l in m...
true
true
1c4406d3ffd11fb02809d090a8f414c71c74c0e7
835
py
Python
tests/acceptance/test_acceptance.py
magmax/livedoc
40b7041bcb36b2a2ebbd3d5906ce5954dbc7f1ca
[ "Python-2.0" ]
null
null
null
tests/acceptance/test_acceptance.py
magmax/livedoc
40b7041bcb36b2a2ebbd3d5906ce5954dbc7f1ca
[ "Python-2.0" ]
2
2016-06-13T08:37:20.000Z
2021-03-22T16:56:10.000Z
tests/acceptance/test_acceptance.py
magmax/livedoc
40b7041bcb36b2a2ebbd3d5906ce5954dbc7f1ca
[ "Python-2.0" ]
null
null
null
import os import unittest import tempfile from livedoc.__main__ import main class LivedocTest(unittest.TestCase): def test_example1(self): this_path = os.path.dirname(__file__) example_path = os.path.join( os.path.dirname(os.path.dirname(this_path)), 'examples', ...
28.793103
57
0.578443
import os import unittest import tempfile from livedoc.__main__ import main class LivedocTest(unittest.TestCase): def test_example1(self): this_path = os.path.dirname(__file__) example_path = os.path.join( os.path.dirname(os.path.dirname(this_path)), 'examples', ...
true
true