hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
351525ff3510e81241132c03602b819a2a740942 | 70 | py | Python | core/src/static_classes/__init__.py | azurlane-doujin/AzurLanePaintingExtract-v1.0 | ef4f25e70b3ca1b9df4304132cc7612c8f5efebb | [
"MIT"
] | 144 | 2019-06-13T06:43:43.000Z | 2022-03-29T15:07:57.000Z | core/src/static_classes/__init__.py | Shabi1213/AzurLanePaintingExtract-v1.0 | ef4f25e70b3ca1b9df4304132cc7612c8f5efebb | [
"MIT"
] | 2 | 2020-08-02T15:08:58.000Z | 2021-11-29T02:34:18.000Z | core/src/static_classes/__init__.py | Goodjooy/ArknightsPaintingExtract | e1e6ef339c6f76cab45a26df66497126c11a21a8 | [
"MIT"
] | 19 | 2020-03-01T10:06:52.000Z | 2022-02-06T13:49:26.000Z | __all__ = ["file_read", 'image_deal', 'search_order', 'static_data']
| 35 | 69 | 0.7 | __all__ = ["file_read", 'image_deal', 'search_order', 'static_data']
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
13e87111dffd55a11464ba7c203a6cc1cb2cb9ac | 412 | py | Python | Demo/wdt/example_wdt_file.py | quecpython/EC100Y-SDK | 712c7eb7b54a3971009d94f6d6b21a6011d56f68 | [
"MIT"
] | 4 | 2021-01-28T01:30:59.000Z | 2021-06-15T07:13:41.000Z | Demo/wdt/example_wdt_file.py | QuePython/EC100Y-SDK | 712c7eb7b54a3971009d94f6d6b21a6011d56f68 | [
"MIT"
] | null | null | null | Demo/wdt/example_wdt_file.py | QuePython/EC100Y-SDK | 712c7eb7b54a3971009d94f6d6b21a6011d56f68 | [
"MIT"
] | 3 | 2021-04-07T09:55:59.000Z | 2022-01-08T15:15:23.000Z | '''
@Author: Pawn
@Date: 2020-08-12
@LastEditTime: 2020-08-12 17:06:08
@Description: example for module timer
@FilePath: example_wdt.py
'''
from machine import WDT
from machine import Timer
timer1 = Timer(Timer.Timer1)
if __name__ == '__main__':
wdt = WDT(20) #
timer1.start(period=15000, mode=timer1.PERIO... | 17.913043 | 78 | 0.682039 | '''
@Author: Pawn
@Date: 2020-08-12
@LastEditTime: 2020-08-12 17:06:08
@Description: example for module timer
@FilePath: example_wdt.py
'''
from machine import WDT
from machine import Timer
timer1 = Timer(Timer.Timer1)
def feed(t):
wdt.feed()
if __name__ == '__main__':
wdt = WDT(20) # 启动看门狗,间隔时长
timer... | 51 | 0 | 0 | 0 | 0 | 6 | 0 | 0 | 23 |
bcb5024cd6f5e64a630af32466bb1b12cbac2b4a | 2,752 | py | Python | users/tests/test_urls.py | jewells07/mumbleapi | beee0b50eefb3b1ff3e21073400c778323eece98 | [
"Apache-2.0"
] | 1 | 2021-05-18T11:37:44.000Z | 2021-05-18T11:37:44.000Z | users/tests/test_urls.py | TomNewton1/mumbleapi | 108d5a841b97d38285bede523f243624e05bc231 | [
"Apache-2.0"
] | null | null | null | users/tests/test_urls.py | TomNewton1/mumbleapi | 108d5a841b97d38285bede523f243624e05bc231 | [
"Apache-2.0"
] | null | null | null | # Create your tests here. | 37.69863 | 87 | 0.703125 | from django.conf.urls import url
from django.urls import reverse , resolve
from rest_framework import status
from rest_framework.test import APITestCase
from users.views import (
followUser , users , UserProfileUpdate ,
ProfilePictureUpdate , usersRecommended ,
user , userMumbles, userArticles, passwordCha... | 0 | 0 | 0 | 2,322 | 0 | 0 | 0 | 272 | 133 |
73e1afd1d4cf91f0ff98fd1d78bfc8ce897e5c54 | 4,921 | py | Python | src/Testing/ZopeTestCase/utils.py | tseaver/Zope-RFA | 08634f39b0f8b56403a2a9daaa6ee4479ef0c625 | [
"ZPL-2.1"
] | 2 | 2015-12-21T10:34:56.000Z | 2017-09-24T11:07:58.000Z | src/Testing/ZopeTestCase/utils.py | MatthewWilkes/Zope | 740f934fc9409ae0062e8f0cd6dcfd8b2df00376 | [
"ZPL-2.1"
] | null | null | null | src/Testing/ZopeTestCase/utils.py | MatthewWilkes/Zope | 740f934fc9409ae0062e8f0cd6dcfd8b2df00376 | [
"ZPL-2.1"
] | null | null | null | ##############################################################################
#
# Copyright (c) 2005 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 31.544872 | 83 | 0.636456 | ##############################################################################
#
# Copyright (c) 2005 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 0 | 1,844 | 0 | 0 | 0 | 0 | 0 | -9 | 68 |
c4ac1344ac12b2b41b5b5813289b0939cfb026e8 | 977 | py | Python | experiments/mcompress/set_options.py | paralab/EigenMM | 5c94233524ae2758ebf47c3b3fdb6570a6cc4e59 | [
"MIT"
] | null | null | null | experiments/mcompress/set_options.py | paralab/EigenMM | 5c94233524ae2758ebf47c3b3fdb6570a6cc4e59 | [
"MIT"
] | null | null | null | experiments/mcompress/set_options.py | paralab/EigenMM | 5c94233524ae2758ebf47c3b3fdb6570a6cc4e59 | [
"MIT"
] | null | null | null | emm_fmt = """<?xml version="1.0" encoding="utf-8" ?>
<EIGEN_MM>
<OPTIONS
_splitmaxiters="10"
_nodesperevaluator="1"
_subproblemsperevaluator="1"
_totalsubproblems="1"
_nevaluators="1"
_taskspernode="%d"
_nevals="-1"
_nk="10"
_nb="4"
_p="0"
_nv="10"
_raditers="20"
_splittol="0.9"
... | 20.354167 | 63 | 0.616172 | emm_fmt = """<?xml version="1.0" encoding="utf-8" ?>
<EIGEN_MM>
<OPTIONS
_splitmaxiters="10"
_nodesperevaluator="1"
_subproblemsperevaluator="1"
_totalsubproblems="1"
_nevaluators="1"
_taskspernode="%d"
_nevals="-1"
_nk="10"
_nb="4"
_p="0"
_nv="10"
_raditers="20"
_splittol="0.9"
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cb18427c6dda988b4a46b9e6269b431bec7b5ea3 | 5,758 | py | Python | qtpyvcp/widgets/display_widgets/atc_widget/atc.py | awigen/qtpyvcp | 5a23c4bca78accb159a76ac03652c74d5a07d14f | [
"BSD-3-Clause-LBNL",
"MIT"
] | null | null | null | qtpyvcp/widgets/display_widgets/atc_widget/atc.py | awigen/qtpyvcp | 5a23c4bca78accb159a76ac03652c74d5a07d14f | [
"BSD-3-Clause-LBNL",
"MIT"
] | null | null | null | qtpyvcp/widgets/display_widgets/atc_widget/atc.py | awigen/qtpyvcp | 5a23c4bca78accb159a76ac03652c74d5a07d14f | [
"BSD-3-Clause-LBNL",
"MIT"
] | null | null | null | import os
# Workarround for nvidia propietary drivers
import ctypes
import ctypes.util
ctypes.CDLL(ctypes.util.find_library("GL"), mode=ctypes.RTLD_GLOBAL)
# end of Workarround
from qtpyvcp.plugins import getPlugin
from qtpyvcp.utilities import logger
LOG = logger.getLogger(__name__)
STATUS = getPlugin('status')... | 30.146597 | 83 | 0.633032 | import os
# Workarround for nvidia propietary drivers
import ctypes
import ctypes.util
ctypes.CDLL(ctypes.util.find_library("GL"), mode=ctypes.RTLD_GLOBAL)
# end of Workarround
from qtpy.QtCore import Signal, Slot, QUrl, QTimer
from qtpy.QtQuickWidgets import QQuickWidget
from qtpyvcp.plugins import getPlugin
fr... | 0 | 0 | 0 | 5,131 | 0 | 0 | 0 | 80 | 90 |
0515dfbce20f8b6db5af0d540ac7d973ccefba31 | 603 | py | Python | oreo_backend/memes/migrations/0003_auto_20211108_1250.py | TaipeiTechIAEWorkplace/Website | fc962d5f8163c08f901fe4d97af14b8e7b3cfc9c | [
"MIT"
] | 1 | 2022-02-06T07:08:13.000Z | 2022-02-06T07:08:13.000Z | oreo_backend/memes/migrations/0003_auto_20211108_1250.py | TaipeiTechIAEWorkplace/Website | fc962d5f8163c08f901fe4d97af14b8e7b3cfc9c | [
"MIT"
] | null | null | null | oreo_backend/memes/migrations/0003_auto_20211108_1250.py | TaipeiTechIAEWorkplace/Website | fc962d5f8163c08f901fe4d97af14b8e7b3cfc9c | [
"MIT"
] | null | null | null | # Generated by Django 3.2.9 on 2021-11-08 04:50
| 22.333333 | 58 | 0.557214 | # Generated by Django 3.2.9 on 2021-11-08 04:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('memes', '0002_auto_20211108_1233'),
]
operations = [
migrations.RemoveField(
model_name='photo',
name='hashtag',
... | 0 | 0 | 0 | 489 | 0 | 0 | 0 | 19 | 46 |
fd2d2d27a90eb687cfa5ddaaf7a717a930d940df | 2,951 | py | Python | ldap_sync/__main__.py | JuKu/pycroft | 15595f9b4327da5c52c77174def73660226da7dc | [
"Apache-2.0"
] | null | null | null | ldap_sync/__main__.py | JuKu/pycroft | 15595f9b4327da5c52c77174def73660226da7dc | [
"Apache-2.0"
] | null | null | null | ldap_sync/__main__.py | JuKu/pycroft | 15595f9b4327da5c52c77174def73660226da7dc | [
"Apache-2.0"
] | null | null | null | import argparse
import logging
from .exporter import logger
logger = logging.getLogger('ldap_sync')
NAME_LEVEL_MAPPING = {
'debug': logging.DEBUG,
'info': logging.INFO,
'warning': logging.WARNING,
'error': logging.ERROR,
'critical': logging.CRITICAL,
}
parser = argparse.ArgumentParser(descr... | 30.42268 | 91 | 0.683497 | import argparse
import logging
import os
from .exporter import add_stdout_logging, establish_and_return_ldap_connection, \
establish_and_return_session, fake_connection, fetch_current_ldap_users, \
fetch_users_to_sync, get_config_or_exit, logger, sync_all
logger = logging.getLogger('ldap_sync')
def sync_... | 0 | 0 | 0 | 0 | 0 | 1,821 | 0 | 184 | 91 |
a20fcaf6ccf8820b917742d329e834e07689579f | 6,837 | py | Python | visdex/exploratory_graphs/__init__.py | mcraig-ibme/visdex | bbf8365e627f6d52fb201ae4ae6fef6775c4d716 | [
"Apache-2.0"
] | null | null | null | visdex/exploratory_graphs/__init__.py | mcraig-ibme/visdex | bbf8365e627f6d52fb201ae4ae6fef6775c4d716 | [
"Apache-2.0"
] | null | null | null | visdex/exploratory_graphs/__init__.py | mcraig-ibme/visdex | bbf8365e627f6d52fb201ae4ae6fef6775c4d716 | [
"Apache-2.0"
] | null | null | null | """
visdex: Exploratory graphs
The exploratory graphs section defines specialised data visualisations that
can be generated by the user on request
"""
import logging
from dash import html, dcc
import plotly.graph_objects as go
from visdex.common import plot_style
LOG = logging.getLogger(__name__)
def generate_gene... | 34.356784 | 91 | 0.511482 | """
visdex: Exploratory graphs
The exploratory graphs section defines specialised data visualisations that
can be generated by the user on request
"""
import logging
from dash import html, dcc
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output, State, MATCH
import plotly.graph_objects... | 0 | 3,069 | 0 | 0 | 0 | 1,717 | 0 | 174 | 90 |
eebf786325342f19a4237a7fea589022310860b1 | 4,982 | py | Python | intel_software/pkg_contents/micperf/CONTENTS/usr/share/micperf/micp/micp/kernels/mkl_conv.py | antoinecarme/xeon-phi-data | 883a6e2f31b2e729715303725f417b2990d923be | [
"BSD-3-Clause"
] | 1 | 2021-07-22T18:01:28.000Z | 2021-07-22T18:01:28.000Z | intel_software/pkg_contents/micperf/CONTENTS/usr/share/micperf/micp/micp/kernels/mkl_conv.py | antoinecarme/xeon-phi-data | 883a6e2f31b2e729715303725f417b2990d923be | [
"BSD-3-Clause"
] | null | null | null | intel_software/pkg_contents/micperf/CONTENTS/usr/share/micperf/micp/micp/kernels/mkl_conv.py | antoinecarme/xeon-phi-data | 883a6e2f31b2e729715303725f417b2990d923be | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2012-2017, Intel Corporation, All Rights Reserved.
#
# This software is supplied under the terms of a license
# agreement or nondisclosure agreement with Intel Corp.
# and may not be copied or disclosed except in accordance
# with the terms of that agreement.
confParamNames = [ 'groups', 'nImg', 'inpWidth... | 35.585714 | 119 | 0.609193 | # Copyright 2012-2017, Intel Corporation, All Rights Reserved.
#
# This software is supplied under the terms of a license
# agreement or nondisclosure agreement with Intel Corp.
# and may not be copied or disclosed except in accordance
# with the terms of that agreement.
import os
import re
import micp.kernel as mic... | 0 | 0 | 0 | 4,059 | 0 | 0 | 0 | 50 | 180 |
5499e89c9e89f497892f031f5a9cc83e7deaabf6 | 610 | py | Python | wfsim/utils.py | jmeyers314/wfsim | c2ad60c100ec1c4046368801a56a5211499f0c51 | [
"BSD-3-Clause"
] | null | null | null | wfsim/utils.py | jmeyers314/wfsim | c2ad60c100ec1c4046368801a56a5211499f0c51 | [
"BSD-3-Clause"
] | null | null | null | wfsim/utils.py | jmeyers314/wfsim | c2ad60c100ec1c4046368801a56a5211499f0c51 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import galsim
def BBSED(T):
"""(unnormalized) Blackbody SED for temperature T in Kelvin.
"""
waves_nm = np.arange(330.0, 1120.0, 10.0)
flambda = planck(T, waves_nm*1e-9)
return galsim.SED(
galsim.LookupTable(waves_nm, flambda),
wave_type='nm',
flux_type='... | 27.727273 | 64 | 0.57377 | import numpy as np
import galsim
def BBSED(T):
"""(unnormalized) Blackbody SED for temperature T in Kelvin.
"""
waves_nm = np.arange(330.0, 1120.0, 10.0)
def planck(t, w):
# t in K
# w in m
c = 2.99792458e8 # speed of light in m/s
kB = 1.3806488e-23 # Boltzmann's cons... | 0 | 0 | 0 | 0 | 0 | 249 | 0 | 0 | 26 |
a5f484ac8ab36970a0402fcb7d92a67abbe863f9 | 1,495 | py | Python | src/app/search.py | delgadofarid/my-first-search-engine | e8ea909030a599bb4bba739fe77747c98395dc29 | [
"Apache-2.0"
] | 1 | 2021-06-05T03:52:21.000Z | 2021-06-05T03:52:21.000Z | src/app/search.py | delgadofarid/my-first-search-engine | e8ea909030a599bb4bba739fe77747c98395dc29 | [
"Apache-2.0"
] | null | null | null | src/app/search.py | delgadofarid/my-first-search-engine | e8ea909030a599bb4bba739fe77747c98395dc29 | [
"Apache-2.0"
] | null | null | null | from elasticsearch import Elasticsearch
# initialize Elasticsearch client
es = Elasticsearch()
| 30.510204 | 103 | 0.626756 | import re
from elasticsearch import Elasticsearch, helpers
from itertools import islice
# initialize Elasticsearch client
es = Elasticsearch()
def first_n(iterable, n):
return islice(iterable, 0, n)
def format_es_response(user_question, es_candidates):
results = list()
for c in es_candidates:
p... | 0 | 0 | 0 | 0 | 0 | 1,279 | 0 | 4 | 113 |
5786c329b92403e4f8b652789de8bbe26502cea4 | 24,221 | py | Python | tests/test_configfetch.py | openandclose/configfetch | fc0b329e6861cc73f0a108ddaea636e6956dd56f | [
"MIT"
] | null | null | null | tests/test_configfetch.py | openandclose/configfetch | fc0b329e6861cc73f0a108ddaea636e6956dd56f | [
"MIT"
] | null | null | null | tests/test_configfetch.py | openandclose/configfetch | fc0b329e6861cc73f0a108ddaea636e6956dd56f | [
"MIT"
] | null | null | null | import functools
import configfetch
fetch_ = configfetch.fetch
fetch = functools.partial(
configfetch.fetch, option_builder=configfetch.FiniOptionBuilder)
# Just checking the standard library's behaviors.
| 24.842051 | 85 | 0.473886 |
import argparse
import configparser
import functools
import textwrap
import pytest
import configfetch
fetch_ = configfetch.fetch
fetch = functools.partial(
configfetch.fetch, option_builder=configfetch.FiniOptionBuilder)
def f(string):
return textwrap.dedent(string.strip('\n'))
def _get_action(conf, op... | 0 | 51 | 0 | 21,633 | 0 | 1,826 | 0 | -22 | 503 |
a5bd7b16ae0ef9281e8935c406154bcc19d183b1 | 10,477 | py | Python | pt3/client.py | Aerun/pytyle3 | 86876fa7ad652fc99b77f5482559733c95490e84 | [
"WTFPL"
] | null | null | null | pt3/client.py | Aerun/pytyle3 | 86876fa7ad652fc99b77f5482559733c95490e84 | [
"WTFPL"
] | null | null | null | pt3/client.py | Aerun/pytyle3 | 86876fa7ad652fc99b77f5482559733c95490e84 | [
"WTFPL"
] | null | null | null |
import xpybutil
import xpybutil.event as event
import xpybutil.ewmh as ewmh
import xpybutil.motif as motif
import xpybutil.icccm as icccm
import xpybutil.rect as rect
import xpybutil.util as util
import xpybutil.window as window
clients = {}
ignore = [] # Some clients are never gunna make it...
event.connect('Proper... | 34.127036 | 98 | 0.592345 | import time
import xcffib.xproto
import xpybutil
import xpybutil.event as event
import xpybutil.ewmh as ewmh
import xpybutil.motif as motif
import xpybutil.icccm as icccm
import xpybutil.rect as rect
import xpybutil.util as util
import xpybutil.window as window
from debug import debug
import config
import state
imp... | 0 | 0 | 0 | 5,878 | 0 | 3,995 | 0 | -36 | 273 |
1782765336d1c920b25f3e04b8d6dd09f0344112 | 905 | py | Python | index_cli/core/json_type.py | lishnih/index_cli | 57f23d5df5168bcc73e23e0eeabbb8317014585b | [
"MIT"
] | null | null | null | index_cli/core/json_type.py | lishnih/index_cli | 57f23d5df5168bcc73e23e0eeabbb8317014585b | [
"MIT"
] | null | null | null | index_cli/core/json_type.py | lishnih/index_cli | 57f23d5df5168bcc73e23e0eeabbb8317014585b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
# Stan 2018-09-27
from __future__ import (division, absolute_import,
print_function, unicode_literals)
# class JsonType(UserDefinedType):
# def get_col_spec(self, **kw):
# return "JSON"
#
# def bind_processor(self, dialect):
# def ... | 23.815789 | 73 | 0.653039 | #!/usr/bin/env python
# coding=utf-8
# Stan 2018-09-27
from __future__ import (division, absolute_import,
print_function, unicode_literals)
import json
from sqlalchemy.types import UserDefinedType, TypeDecorator, Text
class JsonType(TypeDecorator):
impl = Text
def process_bind_para... | 0 | 0 | 0 | 215 | 0 | 0 | 0 | 34 | 69 |
ed5e6c0f6c69ec6fdd90183710bf386418d25c66 | 1,563 | py | Python | tests/test_settings.py | sneJ-/chaostoolkit-lib | 07b00c8bffe8cda7494b049f9640cdbba3bad8bc | [
"Apache-2.0"
] | 1 | 2019-11-18T19:57:42.000Z | 2019-11-18T19:57:42.000Z | tests/test_settings.py | sneJ-/chaostoolkit-lib | 07b00c8bffe8cda7494b049f9640cdbba3bad8bc | [
"Apache-2.0"
] | null | null | null | tests/test_settings.py | sneJ-/chaostoolkit-lib | 07b00c8bffe8cda7494b049f9640cdbba3bad8bc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os.path
settings_dir = os.path.join(os.path.dirname(__file__), "fixtures")
| 28.944444 | 79 | 0.715931 | # -*- coding: utf-8 -*-
import os.path
from chaoslib.settings import get_loaded_settings, load_settings, save_settings
settings_dir = os.path.join(os.path.dirname(__file__), "fixtures")
def test_do_not_fail_when_settings_do_not_exist():
assert load_settings(
os.path.join(settings_dir, "no_settings.yaml"... | 0 | 0 | 0 | 0 | 0 | 1,231 | 0 | 58 | 160 |
0da55faa65c939131e74dd60e3f512e40b9acbf0 | 49 | py | Python | instance/config.py | davideguidobene/cinema-web-app | 1a83576a1e37ea69bec2b2a80f584912cfc9b264 | [
"MIT"
] | null | null | null | instance/config.py | davideguidobene/cinema-web-app | 1a83576a1e37ea69bec2b2a80f584912cfc9b264 | [
"MIT"
] | null | null | null | instance/config.py | davideguidobene/cinema-web-app | 1a83576a1e37ea69bec2b2a80f584912cfc9b264 | [
"MIT"
] | null | null | null | import os
SECRET_KEY = os.getenv("SECRET_KEY")
| 9.8 | 36 | 0.734694 | import os
SECRET_KEY = os.getenv("SECRET_KEY")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7a777dd89c577420d917a03e50e383d90d26f239 | 652 | py | Python | cit_vipnet/inventory/migrations/0002_auto_20210906_1138.py | mr-Marshanskiy/cit-vipnet | 6a0e56a13cae57252957c82af3d4e98da5d9d6a4 | [
"BSD-3-Clause"
] | null | null | null | cit_vipnet/inventory/migrations/0002_auto_20210906_1138.py | mr-Marshanskiy/cit-vipnet | 6a0e56a13cae57252957c82af3d4e98da5d9d6a4 | [
"BSD-3-Clause"
] | null | null | null | cit_vipnet/inventory/migrations/0002_auto_20210906_1138.py | mr-Marshanskiy/cit-vipnet | 6a0e56a13cae57252957c82af3d4e98da5d9d6a4 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.2 on 2021-09-06 08:38
| 29.636364 | 137 | 0.627301 | # Generated by Django 2.2 on 2021-09-06 08:38
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('inventory', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='hardwareplatform',
options={'ordering': ['-n... | 164 | 0 | 0 | 466 | 0 | 0 | 0 | 11 | 46 |
a218e268b041cea723c99b9e20c6c99c665876db | 88 | py | Python | main.py | hailleenvarela/data-2022-1 | 8f92e1325b6fcbf727b426c50ddf32d10e38db89 | [
"MIT"
] | null | null | null | main.py | hailleenvarela/data-2022-1 | 8f92e1325b6fcbf727b426c50ddf32d10e38db89 | [
"MIT"
] | 1 | 2022-02-27T23:23:50.000Z | 2022-02-27T23:23:50.000Z | main.py | hailleenvarela/data-2022-1 | 8f92e1325b6fcbf727b426c50ddf32d10e38db89 | [
"MIT"
] | 3 | 2022-02-27T23:14:24.000Z | 2022-03-02T00:47:12.000Z | from source.etl import ETL
x = ETL()
df = x.extract(True)
x.transform(df)
#x.load(df) | 11 | 26 | 0.670455 | from source.etl import ETL
x = ETL()
df = x.extract(True)
x.transform(df)
#x.load(df) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
97d4c4d8955d3f56c8e11f52c3ceebef2f337f77 | 2,533 | py | Python | 2021/advent2021_9.py | aatango/Advent-of-Code | f229abc7acaaa0a2316839bf11fa7e2fdf9caf2c | [
"MIT"
] | null | null | null | 2021/advent2021_9.py | aatango/Advent-of-Code | f229abc7acaaa0a2316839bf11fa7e2fdf9caf2c | [
"MIT"
] | null | null | null | 2021/advent2021_9.py | aatango/Advent-of-Code | f229abc7acaaa0a2316839bf11fa7e2fdf9caf2c | [
"MIT"
] | null | null | null | """Advent of Code 2021, day 9: Smoke Basin"""
def main(input_matrix: tuple[str]) -> int:
"""
Find all of the low points on your heightmap.
What is the sum of the risk levels of all low points on your heightmap?
"""
# It's a brute force approach that does not scale to part two,
# but it's what I could think of w... | 28.784091 | 83 | 0.684959 | """Advent of Code 2021, day 9: Smoke Basin"""
def main(input_matrix: tuple[str]) -> int:
"""
Find all of the low points on your heightmap.
What is the sum of the risk levels of all low points on your heightmap?
"""
# It's a brute force approach that does not scale to part two,
# but it's what I could think of w... | 0 | 0 | 0 | 0 | 0 | 430 | 0 | 0 | 24 |
8485ba5f72fd09655120694f54a0ea9e297a8fe8 | 545 | py | Python | pythondata_cpu_blackparrot/system_verilog/black-parrot/external/basejump_stl/testing/bsg_test/dramsim3_bandwidth2/const_random.py | litex-hub/pythondata-cpu-blackparrot | ba50883f12d33e1d834640640c84ddc9329bb68a | [
"BSD-3-Clause"
] | 3 | 2021-05-12T21:57:55.000Z | 2021-07-29T19:56:04.000Z | pythondata_cpu_blackparrot/system_verilog/black-parrot/external/basejump_stl/testing/bsg_test/dramsim3_bandwidth2/const_random.py | litex-hub/litex-data-cpu-blackparrot | ba50883f12d33e1d834640640c84ddc9329bb68a | [
"BSD-3-Clause"
] | 1 | 2020-05-02T02:41:24.000Z | 2020-05-02T02:44:25.000Z | pythondata_cpu_blackparrot/system_verilog/black-parrot/external/basejump_stl/testing/bsg_test/dramsim3_bandwidth2/const_random.py | litex-hub/litex-data-cpu-blackparrot | ba50883f12d33e1d834640640c84ddc9329bb68a | [
"BSD-3-Clause"
] | 2 | 2020-05-01T08:33:19.000Z | 2021-07-29T19:56:12.000Z | import sys
import random
if __name__ == "__main__":
random.seed(0)
num_cache_p = int(sys.argv[1])
block_size_in_words_p = int(sys.argv[2])
tg = TraceGen(block_size_in_words_p)
tg.clear_tags()
#words = (2**18)/num_cache_p # 1MB
words = (2**18)/num_cache_p # 1MB
max_range = (2**14)# 64KB
for i in r... | 20.185185 | 47 | 0.66055 | import sys
import random
from trace_gen import *
if __name__ == "__main__":
random.seed(0)
num_cache_p = int(sys.argv[1])
block_size_in_words_p = int(sys.argv[2])
tg = TraceGen(block_size_in_words_p)
tg.clear_tags()
#words = (2**18)/num_cache_p # 1MB
words = (2**18)/num_cache_p # 1MB
max_range = (2*... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 22 |
74ee5adaad45c0809358f0e7260945651ef42945 | 5,699 | py | Python | touchdown/tests/test_aws_vpc_subnet.py | yaybu/touchdown | 70ecda5191ce2d095bc074dcb23bfa1584464814 | [
"Apache-2.0"
] | 14 | 2015-01-05T18:18:04.000Z | 2022-02-07T19:35:12.000Z | touchdown/tests/test_aws_vpc_subnet.py | yaybu/touchdown | 70ecda5191ce2d095bc074dcb23bfa1584464814 | [
"Apache-2.0"
] | 106 | 2015-01-06T00:17:13.000Z | 2019-09-07T00:35:32.000Z | touchdown/tests/test_aws_vpc_subnet.py | yaybu/touchdown | 70ecda5191ce2d095bc074dcb23bfa1584464814 | [
"Apache-2.0"
] | 5 | 2015-01-30T10:18:24.000Z | 2022-02-07T19:35:13.000Z | # Copyright 2015 Isotoma Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 32.565714 | 87 | 0.589402 | # Copyright 2015 Isotoma Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 0 | 0 | 0 | 4,866 | 0 | 0 | 0 | 141 | 113 |
62b58d3a59f61b26ea27943ea666bc132820d76e | 8,597 | py | Python | pymbs/processing/loops/fourbar.py | brutzl/pymbs | fb7c91435f56b5c4d460f82f081d5d1960fea886 | [
"MIT"
] | null | null | null | pymbs/processing/loops/fourbar.py | brutzl/pymbs | fb7c91435f56b5c4d460f82f081d5d1960fea886 | [
"MIT"
] | null | null | null | pymbs/processing/loops/fourbar.py | brutzl/pymbs | fb7c91435f56b5c4d460f82f081d5d1960fea886 | [
"MIT"
] | null | null | null |
AL = 'FB_%s_AL'
BE = 'FB_%s_BE'
GA = 'FB_%s_GA'
DE = 'FB_%s_DE'
L1 = 'FB_%s_L1'
L2 = 'FB_%s_L2'
L3 = 'FB_%s_L3'
L4 = 'FB_%s_L4'
PHI = 'FB_%s_PHI'
PSI = 'FB_%s_PSI'
THETA = 'FB_%s_THETA'
A = 'FB_%s_A'
B = 'FB_%s_B'
C = 'FB_%s_C'
D = 'FB_%s_D'
E = 'FB_%s_E'
F = 'FB_%s_F'
| 35.378601 | 310 | 0.562289 | from pymbs.processing.loops.loop import Loop
from pymbs.common.functions import sqrt
from pymbs.processing import Frame
from pymbs.processing.loads.constraint import Constraint
from numpy import pi
from pymbs.symbolics import Matrix, eye, cos, sin, atan, atan2, acos, zeros, transpose
AL = 'FB_%s_AL'
BE = 'FB_%s_BE'... | 0 | 0 | 0 | 7,975 | 0 | 0 | 0 | 165 | 181 |
127d839e1bbc55e99f4f321f7c332ef610cb53d8 | 1,812 | py | Python | earth_enterprise/src/server/wsgi/wms/ogc/common/image_specs.py | ezeeyahoo/earthenterprise | b6cac9e6228946f2f17d1edb75e118aeb3e8e8c9 | [
"Apache-2.0"
] | 2,661 | 2017-03-20T22:12:50.000Z | 2022-03-30T09:43:19.000Z | earth_enterprise/src/server/wsgi/wms/ogc/common/image_specs.py | ezeeyahoo/earthenterprise | b6cac9e6228946f2f17d1edb75e118aeb3e8e8c9 | [
"Apache-2.0"
] | 1,531 | 2017-03-24T17:20:32.000Z | 2022-03-16T18:11:14.000Z | earth_enterprise/src/server/wsgi/wms/ogc/common/image_specs.py | ezeeyahoo/earthenterprise | b6cac9e6228946f2f17d1edb75e118aeb3e8e8c9 | [
"Apache-2.0"
] | 990 | 2017-03-24T11:54:28.000Z | 2022-03-22T11:51:47.000Z | #!/usr/bin/env python2.7
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 22.65 | 74 | 0.679912 | #!/usr/bin/env python2.7
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 0 | 0 | 0 | 0 | 0 | 44 | 0 | 0 | 23 |
9b3205aefcc2508985db4f069099edf5e7dbfa1b | 662 | py | Python | ClassFromQueryGenerator/CRUDPyMacros/Update.py | UnstableMutex/ClassFromQueryGenerator | 5de03f61059d2c61783a9b66ab4e11060343e803 | [
"MIT"
] | null | null | null | ClassFromQueryGenerator/CRUDPyMacros/Update.py | UnstableMutex/ClassFromQueryGenerator | 5de03f61059d2c61783a9b66ab4e11060343e803 | [
"MIT"
] | null | null | null | ClassFromQueryGenerator/CRUDPyMacros/Update.py | UnstableMutex/ClassFromQueryGenerator | 5de03f61059d2c61783a9b66ab4e11060343e803 | [
"MIT"
] | null | null | null | comma=","
result="SET ANSI_NULLS ON\n"
result+="GO\n"
result+="SET QUOTED_IDENTIFIER ON\n"
result+="GO\n"
result+="CREATE PROCEDURE "+Model.TableName+"_Update\n"
result+=mapcols(pars)
result+="AS\n"
result+="BEGIN\n"
result+="SET NOCOUNT ON;\n"
result+="update [dbo].["+Model.TableName+"]\n"
result+=" set ("
result+=map... | 24.518519 | 55 | 0.669184 |
def sqf(col):
return "["+col.Name+"] = @"+col.Name
def pars(col):
return "@"+col.Name+" "+col.SQLType+"\n"
comma=","
def mapcols(f):
return comma.join(map(f,Model.Columns))
def mapusual(f):
return comma.join(map(f,Model.UsualColumns))
result="SET ANSI_NULLS ON\n"
result+="GO\n"
result+="SET QUOTED_IDENTIFIER ON\n"... | 0 | 0 | 0 | 0 | 0 | 141 | 0 | 0 | 89 |
e33365306faf8e05ad78b480b5ad8b2e0c36c04f | 6,338 | py | Python | tests/core/testRpg.py | rrpg/engine | 989f701b82aa7c73ea98003eed13077e5d6f15f9 | [
"MIT"
] | 2 | 2016-04-07T23:36:46.000Z | 2016-12-20T15:35:17.000Z | tests/core/testRpg.py | rrpg/engine | 989f701b82aa7c73ea98003eed13077e5d6f15f9 | [
"MIT"
] | 5 | 2016-02-04T16:28:33.000Z | 2016-03-18T17:02:07.000Z | tests/core/testRpg.py | rrpg/engine | 989f701b82aa7c73ea98003eed13077e5d6f15f9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 37.502959 | 297 | 0.736668 | # -*- coding: utf-8 -*-
import unittest
import tests.common
import core
from core.localisation import _
from core import Rpg
import models.player
from models.saved_game import saved_game
import json
import sqlite3
class rpgTests(tests.common.common):
idSavedGame = 1
idFaultySavedGame = 2
idEmptySavedGame = 3
in... | 0 | 0 | 0 | 6,098 | 0 | 0 | 0 | -8 | 223 |
b6564c976990b7fa6fc560e5b2308ec16d5f0a89 | 492 | py | Python | ABC/210/c.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | ABC/210/c.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | ABC/210/c.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main()
| 18.923077 | 37 | 0.497967 | from collections import defaultdict
def main():
# input
N, K = map(int, input().split())
cs = [*map(int, input().split())]
# compute
ddict = defaultdict(int)
for i in range(K):
ddict[cs[i]] += 1
ans = len(ddict)
for i in range(N-K):
ddict[cs[i]] -= 1
if ddict[cs... | 0 | 0 | 0 | 0 | 0 | 393 | 0 | 14 | 45 |
da6567f46ca5114b211c9251f1de332e436be104 | 1,892 | py | Python | code/model/intent_classification/intent_classifier_inference.py | vipulraheja/IteraTeR | 80c1939969de909c39e41e16b8866355c038b6d2 | [
"Apache-2.0"
] | 11 | 2022-03-23T21:41:54.000Z | 2022-03-26T13:41:01.000Z | code/model/intent_classification/intent_classifier_inference.py | vipulraheja/IteraTeR | 80c1939969de909c39e41e16b8866355c038b6d2 | [
"Apache-2.0"
] | null | null | null | code/model/intent_classification/intent_classifier_inference.py | vipulraheja/IteraTeR | 80c1939969de909c39e41e16b8866355c038b6d2 | [
"Apache-2.0"
] | 1 | 2022-03-24T15:55:16.000Z | 2022-03-24T15:55:16.000Z | import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--checkpoint', '-c', required=True,
help='path to Pegasus model checkpoint')
args = parser.parse_args()
main(args) | 35.037037 | 132 | 0.691332 | import json
import torch
import argparse
import numpy as np
from transformers.modeling_outputs import SequenceClassifierOutput
from transformers import Trainer, TrainingArguments, RobertaTokenizer, RobertaModel, RobertaConfig, RobertaForSequenceClassification
def main(args):
checkpoint = args.checkpoint
model_... | 0 | 0 | 0 | 0 | 0 | 1,370 | 0 | 134 | 133 |
740141a9f07306e45b5ebf41d61bb31b1b134c05 | 2,035 | py | Python | Forms/mengban_seed.py | UlordChain/uwallet-client | c41f89f34dd17699cb4b285dbba9053f28be5603 | [
"MIT"
] | 19 | 2018-08-21T06:25:30.000Z | 2018-08-21T12:34:14.000Z | Forms/mengban_seed.py | UlordChain/uwallet-client | c41f89f34dd17699cb4b285dbba9053f28be5603 | [
"MIT"
] | 1 | 2018-06-01T09:14:36.000Z | 2018-06-01T09:20:49.000Z | Forms/mengban_seed.py | UlordChain/uwallet-client | c41f89f34dd17699cb4b285dbba9053f28be5603 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2017/12/18
# @Author : Shu
# @Email : httpservlet@yeah.net
| 40.7 | 89 | 0.584767 | # -*- coding: utf-8 -*-
# @Time : 2017/12/18
# @Author : Shu
# @Email : httpservlet@yeah.net
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from FormUI.ui_getseed import Ui_getseedWD
class SeedWidget(QWidget, Ui_getseedWD):
def __init__(self, parent=None):
super(SeedWidget, self).__init__(par... | 30 | 0 | 0 | 1,804 | 0 | 0 | 0 | 30 | 90 |
f52c7e893c3ecdab0771489d791ee3bc29fa08c0 | 325 | py | Python | test/test_json_equal.py | dakotahawkins/MCSchematicIntersection | a5bc130c9f887ca6a253c0a6508fcbca5f164df5 | [
"MIT"
] | null | null | null | test/test_json_equal.py | dakotahawkins/MCSchematicIntersection | a5bc130c9f887ca6a253c0a6508fcbca5f164df5 | [
"MIT"
] | null | null | null | test/test_json_equal.py | dakotahawkins/MCSchematicIntersection | a5bc130c9f887ca6a253c0a6508fcbca5f164df5 | [
"MIT"
] | null | null | null | """Tests two schematic json files to ensure they're equal
"""
import json
import sys
INPUT_A: str = sys.argv[1]
INPUT_B: str = sys.argv[2]
with open(INPUT_A, 'r') as infile_a:
with open(INPUT_B, 'r') as infile_b:
if json.load(infile_a)['nbt'] != json.load(infile_b)['nbt']:
sys.exit(1)
sys.exi... | 21.666667 | 68 | 0.64 | """Tests two schematic json files to ensure they're equal
"""
import json
import sys
INPUT_A: str = sys.argv[1]
INPUT_B: str = sys.argv[2]
with open(INPUT_A, 'r') as infile_a:
with open(INPUT_B, 'r') as infile_b:
if json.load(infile_a)['nbt'] != json.load(infile_b)['nbt']:
sys.exit(1)
sys.exi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ae2007157bf4f09f792df527fa386d5e97a2fa2a | 54 | py | Python | kenning/resources/reports/__init__.py | antmicro/edge-ai-tester | 6b145145ed1cec206ae0229c846fb33d272f3ffa | [
"Apache-2.0"
] | 20 | 2021-06-24T13:37:21.000Z | 2022-03-25T10:50:26.000Z | kenning/resources/reports/__init__.py | antmicro/edge-ai-tester | 6b145145ed1cec206ae0229c846fb33d272f3ffa | [
"Apache-2.0"
] | null | null | null | kenning/resources/reports/__init__.py | antmicro/edge-ai-tester | 6b145145ed1cec206ae0229c846fb33d272f3ffa | [
"Apache-2.0"
] | 1 | 2021-11-09T17:23:04.000Z | 2021-11-09T17:23:04.000Z | """
Contains the templates for benchmark reports.
"""
| 13.5 | 45 | 0.722222 | """
Contains the templates for benchmark reports.
"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ae71a18b83fe0ab9540c787415a3e73b56ccb447 | 1,884 | py | Python | fs.py | mission-liao/fin-stmt-additional | da9ef5299e6ff10406996d0cb0975b46498d3c39 | [
"MIT"
] | null | null | null | fs.py | mission-liao/fin-stmt-additional | da9ef5299e6ff10406996d0cb0975b46498d3c39 | [
"MIT"
] | null | null | null | fs.py | mission-liao/fin-stmt-additional | da9ef5299e6ff10406996d0cb0975b46498d3c39 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
if __name__ == '__main__':
cli()
| 28.984615 | 75 | 0.685775 | # -*- coding: utf-8 -*-
import os
import click
from fstmt import TableAdaptorFactory, DashboardFactory, table
def get_data_dir():
return os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')
def get_database_path():
return os.path.join(get_data_dir(), 'fstmt.sqlite')
@click.group()
def cli():
... | 0 | 1,441 | 0 | 0 | 0 | 133 | 0 | 20 | 228 |
b3a45dcb40d939002cd6cc74fed37e8c87cd19b8 | 2,539 | py | Python | rbtools/clients/tests/test_scanning.py | fangwentong/rbtools | c09f5c93fd61d447dee19b643ddfcf00ba92f920 | [
"MIT"
] | null | null | null | rbtools/clients/tests/test_scanning.py | fangwentong/rbtools | c09f5c93fd61d447dee19b643ddfcf00ba92f920 | [
"MIT"
] | null | null | null | rbtools/clients/tests/test_scanning.py | fangwentong/rbtools | c09f5c93fd61d447dee19b643ddfcf00ba92f920 | [
"MIT"
] | 1 | 2020-06-27T23:08:47.000Z | 2020-06-27T23:08:47.000Z | """Unit tests for client scanning."""
from __future__ import unicode_literals
| 35.760563 | 78 | 0.648681 | """Unit tests for client scanning."""
from __future__ import unicode_literals
import os
from rbtools.clients import scan_usable_client
from rbtools.clients.git import GitClient
from rbtools.clients.svn import SVNClient
from rbtools.clients.tests import SCMClientTests
from rbtools.utils.process import execute
class... | 0 | 0 | 0 | 2,202 | 0 | 0 | 0 | 100 | 157 |
0662e69a71e1cc9d3473c7b9d5a6fe55d4510954 | 2,858 | py | Python | tests/test_archive.py | lgq2015/ubuntu-isign | 2b72d0c260d13e1dce4a9438a9b0cb566a0fcdaf | [
"Apache-2.0"
] | null | null | null | tests/test_archive.py | lgq2015/ubuntu-isign | 2b72d0c260d13e1dce4a9438a9b0cb566a0fcdaf | [
"Apache-2.0"
] | null | null | null | tests/test_archive.py | lgq2015/ubuntu-isign | 2b72d0c260d13e1dce4a9438a9b0cb566a0fcdaf | [
"Apache-2.0"
] | 1 | 2020-10-26T17:36:54.000Z | 2020-10-26T17:36:54.000Z | import logging
log = logging.getLogger(__name__)
| 32.477273 | 89 | 0.731631 | from isign_base_test import IsignBaseTest
from isign.archive import archive_factory, Archive, AppArchive, AppZipArchive, IpaArchive
from isign.utils import PY3
import logging
log = logging.getLogger(__name__)
class TestArchive(IsignBaseTest):
def _test_good(self, filename, klass):
archive = archive_fact... | 0 | 0 | 0 | 2,576 | 0 | 0 | 0 | 94 | 135 |
628390e7b0e104bdccc43edd629d89f2f161d0b5 | 4,769 | py | Python | cotrendy/lightcurves.py | PLATO-Mission/cotrendy | 31d03f0cfd8329f72d897e84d2aa6c0ca8865dfe | [
"MIT"
] | null | null | null | cotrendy/lightcurves.py | PLATO-Mission/cotrendy | 31d03f0cfd8329f72d897e84d2aa6c0ca8865dfe | [
"MIT"
] | null | null | null | cotrendy/lightcurves.py | PLATO-Mission/cotrendy | 31d03f0cfd8329f72d897e84d2aa6c0ca8865dfe | [
"MIT"
] | null | null | null | """
Light curves components for Cotrendy
"""
import sys
import logging
import cotrendy.utils as cuts
def load_photometry(config, apply_object_mask=True):
"""
Read in a photometry file
Parameters
----------
config : dict
Configuration file loaded via TOML
apply_object_mask : boolean
... | 29.993711 | 89 | 0.585657 | """
Light curves components for Cotrendy
"""
import sys
import logging
import numpy as np
from scipy.stats import median_absolute_deviation
import cotrendy.utils as cuts
def load_photometry(config, apply_object_mask=True):
"""
Read in a photometry file
Parameters
----------
config : dict
C... | 2 | 0 | 0 | 2,747 | 0 | 0 | 0 | 25 | 67 |
c4d9e25825d0a67968b72afbc467451be752f281 | 1,954 | py | Python | BigQuery_Script.py | rezaho/iipp_patstat2018 | b83e913a124113052dfbfc5d43ef9d9f6a3f7af0 | [
"Apache-2.0"
] | null | null | null | BigQuery_Script.py | rezaho/iipp_patstat2018 | b83e913a124113052dfbfc5d43ef9d9f6a3f7af0 | [
"Apache-2.0"
] | null | null | null | BigQuery_Script.py | rezaho/iipp_patstat2018 | b83e913a124113052dfbfc5d43ef9d9f6a3f7af0 | [
"Apache-2.0"
] | null | null | null | # Script for creating and loading PatStat2018b dataset into Big Query tables
# coding: utf-8
###############################################
###### Importing Libraries and functions ######
from google.cloud import bigquery
from open_patstat.utils.gcp import create_table
from open_patstat.utils.schema import Schema
#... | 34.892857 | 97 | 0.665814 | # Script for creating and loading PatStat2018b dataset into Big Query tables
# coding: utf-8
###############################################
###### Importing Libraries and functions ######
from google.cloud import bigquery
from open_patstat.utils.gcp import create_table, load_gcs_file, delete_table
from open_patstat.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 29 | 0 |
fc24f84cff67f66fdbc72dc2ba547c523b3814fe | 828 | py | Python | external/cclib/bridge/cclib2pyquante.py | faribas/RMG-Py | 6149e29b642bf8da9537e2db98f15121f0e040c7 | [
"MIT"
] | 1 | 2017-12-18T18:43:22.000Z | 2017-12-18T18:43:22.000Z | external/cclib/bridge/cclib2pyquante.py | speth/RMG-Py | 1d2c2b684580396e984459d9347628a5ceb80e2e | [
"MIT"
] | 72 | 2016-06-06T18:18:49.000Z | 2019-11-17T03:21:10.000Z | external/cclib/bridge/cclib2pyquante.py | speth/RMG-Py | 1d2c2b684580396e984459d9347628a5ceb80e2e | [
"MIT"
] | 3 | 2017-09-22T15:47:37.000Z | 2021-12-30T23:51:47.000Z | """
cclib (http://cclib.sf.net) is (c) 2006, the cclib development team
and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html).
"""
__revision__ = "$Revision: 737 $"
from PyQuante.Molecule import Molecule
def makepyquante(atomcoords, atomnos, charge=0, mult=1):
"""Create a PyQuante Molecule.
>>... | 29.571429 | 74 | 0.621981 | """
cclib (http://cclib.sf.net) is (c) 2006, the cclib development team
and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html).
"""
__revision__ = "$Revision: 737 $"
from PyQuante.Molecule import Molecule
def makepyquante(atomcoords, atomnos, charge=0, mult=1):
"""Create a PyQuante Molecule.
>>... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f9a937ded3908623f9ea6aa4b476025ff2324f45 | 1,106 | py | Python | NBATextAlerts/Alerts.py | kevinfjiang/NBATextAlerts | 0ddd4fc0fa7a272191c422167350d8813581675b | [
"MIT"
] | 1 | 2021-03-24T04:39:40.000Z | 2021-03-24T04:39:40.000Z | NBATextAlerts/Alerts.py | kevinfjiang/NBATextAlerts | 0ddd4fc0fa7a272191c422167350d8813581675b | [
"MIT"
] | 1 | 2021-03-24T05:33:20.000Z | 2021-03-24T05:36:28.000Z | NBATextAlerts/Alerts.py | kevinfjiang/NBATextAlerts | 0ddd4fc0fa7a272191c422167350d8813581675b | [
"MIT"
] | null | null | null | """
https://www.twilio.com/
This link is the basis for the text messaging, make sure to sign up!
After registering, press the home buton and click "Dashboard", both in the top left
You will see the following lines
"cellphone" -> Paste verified Twilio number as string
"ACCOUNT SID" -> Paste that number into account as... | 30.722222 | 103 | 0.711573 | """
https://www.twilio.com/
This link is the basis for the text messaging, make sure to sign up!
After registering, press the home buton and click "Dashboard", both in the top left
You will see the following lines
"cellphone" -> Paste verified Twilio number as string
"ACCOUNT SID" -> Paste that number into account as... | 0 | 0 | 0 | 0 | 0 | 170 | 0 | 9 | 46 |
abfd30e1b28d8aa306ca97c0ff99e36c6c64c29c | 2,546 | py | Python | utils/timer.py | FanmingL/ESCP | 518f13f8b002d142f670f52d9ef34778e2c2d59f | [
"MIT"
] | null | null | null | utils/timer.py | FanmingL/ESCP | 518f13f8b002d142f670f52d9ef34778e2c2d59f | [
"MIT"
] | null | null | null | utils/timer.py | FanmingL/ESCP | 518f13f8b002d142f670f52d9ef34778e2c2d59f | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
test_timer() | 33.064935 | 89 | 0.569521 | import time
import inspect
import numpy as np
class Timer:
def __init__(self):
self.check_points = {}
self.points_time = {}
self.need_summary = {}
self.init_time = time.time()
def reset(self):
self.check_points = {}
self.points_time = {}
self.need_summar... | 0 | 376 | 0 | 1,873 | 0 | 160 | 0 | -20 | 112 |
f7642e021866ac47a0bcd5fd062c3e4fbd79be21 | 4,042 | py | Python | src/interface_py/h2o4gpu/util/lightgbm_dynamic.py | pnijhara/h2o4gpu | 6257112c134136471420b68241f57190a445b67d | [
"Apache-2.0"
] | 458 | 2017-09-20T08:32:10.000Z | 2022-02-28T18:40:57.000Z | src/interface_py/h2o4gpu/util/lightgbm_dynamic.py | Jun-NIBS/h2o4gpu | 9885416deb3285f5d0f33023d6c07373ac4fc0b7 | [
"Apache-2.0"
] | 461 | 2017-09-20T11:39:04.000Z | 2021-11-21T15:51:42.000Z | src/interface_py/h2o4gpu/util/lightgbm_dynamic.py | Jun-NIBS/h2o4gpu | 9885416deb3285f5d0f33023d6c07373ac4fc0b7 | [
"Apache-2.0"
] | 114 | 2017-09-20T12:08:07.000Z | 2021-11-29T14:15:40.000Z | # pylint: skip-file
import os
import importlib.util
got_cpu_lgb = False
got_gpu_lgb = False
from h2o4gpu.util.gpu import device_count
_, ngpus_vis_global = device_count()
enable_lightgbm_import = True
if enable_lightgbm_import:
lgb_loader = importlib.util.find_spec('lightgbm')
lgb_found = lgb_loader is not... | 47.552941 | 222 | 0.543295 | # pylint: skip-file
import os
import importlib.util
got_cpu_lgb = False
got_gpu_lgb = False
from h2o4gpu.util.gpu import device_count
_, ngpus_vis_global = device_count()
enable_lightgbm_import = True
if enable_lightgbm_import:
lgb_loader = importlib.util.find_spec('lightgbm')
lgb_found = lgb_loader is not... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
188ee1b65907db67dfd917f80e2a5d76fdb2dca5 | 1,967 | py | Python | google-cloud-sdk/lib/surface/resource_manager/folders/undelete.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/.install/.backup/lib/surface/resource_manager/folders/undelete.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/surface/resource_manager/folders/undelete.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 33.338983 | 74 | 0.744281 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 0 | 1,026 | 0 | 0 | 0 | 0 | 0 | 152 | 157 |
5a28b79a46e2fcfa07d776568c13a7328fded066 | 417 | py | Python | contract/tests/ownership.py | ebloc/eBlocBroker | 52d507835a0fe3c930df2e2c816724d26a3484a7 | [
"MIT"
] | 7 | 2018-02-10T22:57:28.000Z | 2020-11-20T14:46:18.000Z | contract/tests/ownership.py | ebloc/eBlocBroker | 52d507835a0fe3c930df2e2c816724d26a3484a7 | [
"MIT"
] | 5 | 2020-10-30T18:43:27.000Z | 2021-02-04T12:39:30.000Z | contract/tests/ownership.py | ebloc/eBlocBroker | 52d507835a0fe3c930df2e2c816724d26a3484a7 | [
"MIT"
] | 5 | 2017-07-06T14:14:13.000Z | 2019-02-22T14:40:16.000Z | #!/usr/bin/python3
import pytest
from utils import ZERO_ADDRESS
from brownie import accounts
def test_ownership(Ebb):
"""Get Owner"""
assert Ebb.getOwner() == accounts[0]
with pytest.reverts(): # transferOwnership should revert
Ebb.transferOwnership(ZERO_ADDRESS, {"from": accounts[0]})
Eb... | 23.166667 | 66 | 0.695444 | #!/usr/bin/python3
import pytest
from utils import ZERO_ADDRESS
from brownie import accounts
def test_ownership(Ebb):
"""Get Owner"""
assert Ebb.getOwner() == accounts[0]
with pytest.reverts(): # transferOwnership should revert
Ebb.transferOwnership(ZERO_ADDRESS, {"from": accounts[0]})
Eb... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d4bf808de2a868ba73315da564d256636fe0b32b | 2,858 | py | Python | gd/api/_property.py | scottwedge/gd.py | 328c9833abc949b1c9ac0eabe276bd66fead4c2c | [
"MIT"
] | null | null | null | gd/api/_property.py | scottwedge/gd.py | 328c9833abc949b1c9ac0eabe276bd66fead4c2c | [
"MIT"
] | null | null | null | gd/api/_property.py | scottwedge/gd.py | 328c9833abc949b1c9ac0eabe276bd66fead4c2c | [
"MIT"
] | null | null | null | """Automatic object property code generator."""
from gd.api.enums import (ColorChannelProperties, LevelDataEnum, LevelHeaderEnum, ObjectDataEnum)
__all__ = ("_template", "_create", "_object_code", "_color_code", "_header_code", "_level_code")
_template = """
@property
def {name}(self):
\"\"\":class:`{cls}`: Prop... | 23.816667 | 96 | 0.573828 | """Automatic object property code generator."""
from gd.typing import Enum, Union
from gd.api.enums import (
ColorChannelProperties,
LevelDataEnum,
LevelHeaderEnum,
ObjectDataEnum,
PlayerColor,
)
from gd.api.parser import ( # type: ignore
_INT,
_BOOL,
_FLOAT,
_HSV,
_ENUMS,
... | 0 | 0 | 0 | 0 | 0 | 1,575 | 0 | 365 | 113 |
ffc6fc0c01a161fba017b7f74580eecc40db4a94 | 286 | py | Python | test.py | picturate/picturate | 9f8e69fef7b600b6d8c1ade41a0ccfc382992e8b | [
"Apache-2.0"
] | 4 | 2020-08-03T04:16:53.000Z | 2020-11-02T20:11:16.000Z | test.py | picturate/picturate | 9f8e69fef7b600b6d8c1ade41a0ccfc382992e8b | [
"Apache-2.0"
] | 6 | 2020-09-04T12:36:08.000Z | 2021-06-18T04:31:29.000Z | test.py | picturate/picturate | 9f8e69fef7b600b6d8c1ade41a0ccfc382992e8b | [
"Apache-2.0"
] | 1 | 2020-07-24T07:29:46.000Z | 2020-07-24T07:29:46.000Z | from picturate.config import CAttnGANConfig
from picturate.nets import CAttnGAN
config = CAttnGANConfig('bird')
gan = CAttnGAN(config, pretrained=True)
caption = "This little bird is blue with short beak and white underbelly"
filename = 'bird'
gan.generate_image(caption, filename)
| 23.833333 | 73 | 0.793706 | from picturate.config import CAttnGANConfig
from picturate.nets import CAttnGAN
config = CAttnGANConfig('bird')
gan = CAttnGAN(config, pretrained=True)
caption = "This little bird is blue with short beak and white underbelly"
filename = 'bird'
gan.generate_image(caption, filename)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
409729662516480907dfc439cb222223768f41e8 | 14,838 | py | Python | tests/unit/test_maxmin.py | mzelling/syndata | bba1c4a7b142f1da332d6613baae30b8b97c4e9b | [
"MIT"
] | null | null | null | tests/unit/test_maxmin.py | mzelling/syndata | bba1c4a7b142f1da332d6613baae30b8b97c4e9b | [
"MIT"
] | null | null | null | tests/unit/test_maxmin.py | mzelling/syndata | bba1c4a7b142f1da332d6613baae30b8b97c4e9b | [
"MIT"
] | null | null | null | import pytest
import numpy as np
from syndata.maxmin import MaxMinClusters, MaxMinCov, MaxMinBal, maxmin_sampler
# Test Cases for maxmin_sampler
def test_maxmin_sampler():
"""
Make sure the sampling mechanism doesn't break when wrong inputs
are supplied.
"""
# Test cases throwing exceptions
args_causing_except... | 33.722727 | 100 | 0.709934 | import pytest
import numpy as np
from syndata.core import ClusterData
from syndata.maxmin import MaxMinClusters, MaxMinCov, MaxMinBal, maxmin_sampler
# Test Cases for maxmin_sampler
def test_maxmin_sampler():
"""
Make sure the sampling mechanism doesn't break when wrong inputs
are supplied.
"""
# Test cases th... | 0 | 287 | 0 | 0 | 0 | 0 | 0 | 15 | 69 |
f547cb46376f6cd48fe72244973add9c82d457c0 | 122 | py | Python | configs/scheduler_cfgs/multi_step_lr_cfg.py | slothfulxtx/TransLoc3D | 0ac324b1dcec456c76d7db2f87d13c076f2d55e4 | [
"MIT"
] | 5 | 2021-09-30T08:12:26.000Z | 2022-01-19T16:20:10.000Z | configs/scheduler_cfgs/multi_step_lr_cfg.py | slothfulxtx/TransLoc3D | 0ac324b1dcec456c76d7db2f87d13c076f2d55e4 | [
"MIT"
] | null | null | null | configs/scheduler_cfgs/multi_step_lr_cfg.py | slothfulxtx/TransLoc3D | 0ac324b1dcec456c76d7db2f87d13c076f2d55e4 | [
"MIT"
] | null | null | null | scheduler_type = 'MultiStepLR'
scheduler_cfg = dict(
gamma=0.5,
milestones=(50, 100, 150, 200)
)
end_epoch = 250
| 15.25 | 34 | 0.672131 | scheduler_type = 'MultiStepLR'
scheduler_cfg = dict(
gamma=0.5,
milestones=(50, 100, 150, 200)
)
end_epoch = 250
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d9f7438220a4ebe74beaea888af37f17f5bfb665 | 721 | py | Python | levenshtein_distance.py | int2str/catbot | d6279845eb51eaa9c9e9f2aef2f7a521432d7851 | [
"MIT"
] | null | null | null | levenshtein_distance.py | int2str/catbot | d6279845eb51eaa9c9e9f2aef2f7a521432d7851 | [
"MIT"
] | null | null | null | levenshtein_distance.py | int2str/catbot | d6279845eb51eaa9c9e9f2aef2f7a521432d7851 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 1 14:54:14 2020
@author: Mei
"""
| 18.487179 | 74 | 0.468793 | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 1 14:54:14 2020
@author: Mei
"""
def memoize(func):
mem = {}
def memoizer(*args, **kwargs):
key = str(args) + str(kwargs)
if key not in mem:
mem[key] = func(*args, **kwargs)
return mem[key]
return memoizer
@memoize
de... | 0 | 390 | 0 | 0 | 0 | 201 | 0 | 0 | 46 |
b2e9ce95b9c470541c1124a564f290f253410919 | 9,658 | py | Python | applications/FluidDynamicsApplication/tests/embedded_reservoir_test.py | AndreaVoltan/MyKratos7.0 | e977752722e8ef1b606f25618c4bf8fd04c434cc | [
"BSD-4-Clause"
] | 2 | 2020-04-30T19:13:08.000Z | 2021-04-14T19:40:47.000Z | applications/FluidDynamicsApplication/tests/embedded_reservoir_test.py | AndreaVoltan/MyKratos7.0 | e977752722e8ef1b606f25618c4bf8fd04c434cc | [
"BSD-4-Clause"
] | 1 | 2020-04-30T19:19:09.000Z | 2020-05-02T14:22:36.000Z | applications/FluidDynamicsApplication/tests/embedded_reservoir_test.py | AndreaVoltan/MyKratos7.0 | e977752722e8ef1b606f25618c4bf8fd04c434cc | [
"BSD-4-Clause"
] | 1 | 2020-06-12T08:51:24.000Z | 2020-06-12T08:51:24.000Z | import KratosMultiphysics.kratos_utilities as KratosUtilities
have_external_solvers = KratosUtilities.IsApplicationAvailable("ExternalSolversApplication")
if __name__ == '__main__':
test = EmbeddedReservoirTest()
test.setUp()
test.distance = 0.5
test.slip_level_set = False
test.print_output = False... | 45.130841 | 203 | 0.657693 | import KratosMultiphysics
import KratosMultiphysics.FluidDynamicsApplication as KratosFluid
import KratosMultiphysics.kratos_utilities as KratosUtilities
have_external_solvers = KratosUtilities.IsApplicationAvailable("ExternalSolversApplication")
import KratosMultiphysics.KratosUnittest as UnitTest
@UnitTest.skipUnle... | 0 | 8,846 | 0 | 0 | 0 | 0 | 0 | 79 | 90 |
68e1ed0ef59a3040f7e29f35297d861200c09805 | 454 | py | Python | tests/conftest.py | BradleyKirton/ice3x | 7a289b6b208a0bd07112744923cf5d315982ee31 | [
"MIT"
] | null | null | null | tests/conftest.py | BradleyKirton/ice3x | 7a289b6b208a0bd07112744923cf5d315982ee31 | [
"MIT"
] | 1 | 2021-01-18T09:38:53.000Z | 2021-01-18T09:38:53.000Z | tests/conftest.py | BradleyKirton/ice3x | 7a289b6b208a0bd07112744923cf5d315982ee31 | [
"MIT"
] | 1 | 2021-01-15T05:15:08.000Z | 2021-01-15T05:15:08.000Z | import pytest
def pytest_collection_modifyitems(config, items):
"""If async dependencies is not available skip async tests."""
try:
skip_async = False
except ImportError:
skip_async = True
skip_slow = pytest.mark.skip(reason="need --runslow option to run")
for item in items:
... | 23.894737 | 71 | 0.665198 | import pytest
def pytest_collection_modifyitems(config, items):
"""If async dependencies is not available skip async tests."""
try:
import treq # noqa
skip_async = False
except ImportError:
skip_async = True
skip_slow = pytest.mark.skip(reason="need --runslow option to run"... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 38 |
1f318af426ba6effdcc824c35b1410a508967992 | 605 | py | Python | python/train_model.py | bfakhri/dml_custom | 1e908b10890df11e510d72c21f3125e3069a0eac | [
"CC-BY-4.0"
] | null | null | null | python/train_model.py | bfakhri/dml_custom | 1e908b10890df11e510d72c21f3125e3069a0eac | [
"CC-BY-4.0"
] | null | null | null | python/train_model.py | bfakhri/dml_custom | 1e908b10890df11e510d72c21f3125e3069a0eac | [
"CC-BY-4.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import sys
print('PYTHON VERSION - ', sys.version)
# For the DML random agent dataset
import random_dataset
# For the model that we will train
import model
# For debugging
import os
f... | 18.90625 | 39 | 0.771901 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import argparse
import random
import numpy as np
import deepmind_lab
import tensorflow as tf
import sys
print('PYTHON VERSION - ', sys.version)
# For the DML random agent dataset
impo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -17 | 111 |
61db0562dc232d4ff5aad924e5350c8b5a68b06a | 503 | py | Python | hub/models/types.py | harenlewis/api-hub | f79cd8b82e95c039269765a4542866286803a322 | [
"MIT"
] | null | null | null | hub/models/types.py | harenlewis/api-hub | f79cd8b82e95c039269765a4542866286803a322 | [
"MIT"
] | 2 | 2020-06-05T19:41:09.000Z | 2021-06-10T21:07:30.000Z | hub/models/types.py | harenlewis/api-hub | f79cd8b82e95c039269765a4542866286803a322 | [
"MIT"
] | null | null | null | GET = 100
POST = 200
PUT = 300
DELETE = 400
METHOD_TYPES = (
(GET, 'GET'),
(POST, 'POST'),
(PUT, 'PUT'),
(DELETE, 'DELETE'),
)
METHOD_TYPES_DICT = {
'GET': GET,
'POST': POST,
'PUT': PUT,
'DELETE': DELETE,
}
JSON = 500
HTML = 600
TEXT = 700
RESP_TYPES = (
(JSON, 'JSON'),
(HTML... | 14.794118 | 46 | 0.532803 | GET = 100
POST = 200
PUT = 300
DELETE = 400
METHOD_TYPES = (
(GET, 'GET'),
(POST, 'POST'),
(PUT, 'PUT'),
(DELETE, 'DELETE'),
)
METHOD_TYPES_DICT = {
'GET': GET,
'POST': POST,
'PUT': PUT,
'DELETE': DELETE,
}
JSON = 500
HTML = 600
TEXT = 700
RESP_TYPES = (
(JSON, 'JSON'),
(HTML... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
69dfa3f3f3c61dd8f1cd49fd9d62071055662676 | 3,962 | py | Python | genome_designer/tests/integration/test_pipeline_integration.py | churchlab/millstone | ddb5d003a5b8a7675e5a56bafd5c432d9642b473 | [
"MIT"
] | 45 | 2015-09-30T14:55:33.000Z | 2021-06-28T02:33:30.000Z | genome_designer/tests/integration/test_pipeline_integration.py | churchlab/millstone | ddb5d003a5b8a7675e5a56bafd5c432d9642b473 | [
"MIT"
] | 261 | 2015-06-03T20:41:56.000Z | 2022-03-07T08:46:10.000Z | genome_designer/tests/integration/test_pipeline_integration.py | churchlab/millstone | ddb5d003a5b8a7675e5a56bafd5c432d9642b473 | [
"MIT"
] | 22 | 2015-06-04T20:43:10.000Z | 2022-02-27T08:27:34.000Z | """Alignment pipeline integration tests.
"""
import os
from django.conf import settings
TEST_FASTA = os.path.join(settings.PWD, 'test_data', 'fake_genome_and_reads',
'test_genome.fa')
TEST_FASTQ1 = os.path.join(settings.PWD, 'test_data', 'fake_genome_and_reads',
'38d786f2', 'test_genome_1.snps.simL... | 38.096154 | 80 | 0.69687 | """Alignment pipeline integration tests.
"""
import os
import time
from django.conf import settings
from djcelery_testworker.testcase import CeleryWorkerTestCase
from main.models import AlignmentGroup
from main.models import Dataset
from main.models import ExperimentSample
from main.testing_util import create_common... | 0 | 0 | 0 | 2,954 | 0 | 0 | 0 | 269 | 266 |
c03319542f2244c2d4ef46ea8722b2475a06c15b | 793 | py | Python | topics/Array/Best_Time_to_Buy_and_Sell_Stock_121/Best_Time_to_Buy_and_Sell_Stock_121.py | DmitryNaimark/leetcode-solutions-python | 16af5f3a9cb8469d82b14c8953847f0e93a92324 | [
"MIT"
] | 1 | 2019-10-31T11:06:23.000Z | 2019-10-31T11:06:23.000Z | topics/Array/Best_Time_to_Buy_and_Sell_Stock_121/Best_Time_to_Buy_and_Sell_Stock_121.py | DmitryNaimark/leetcode-solutions-python | 16af5f3a9cb8469d82b14c8953847f0e93a92324 | [
"MIT"
] | null | null | null | topics/Array/Best_Time_to_Buy_and_Sell_Stock_121/Best_Time_to_Buy_and_Sell_Stock_121.py | DmitryNaimark/leetcode-solutions-python | 16af5f3a9cb8469d82b14c8953847f0e93a92324 | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
# ---------------------------------------------------
# Runtime Complexity: O(N)
# Space Complexity: O(1)
# ---------------------------------------------------
# Test Cases
# ---------------------------------------------------
soluti... | 27.344828 | 64 | 0.461538 | # https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
# ---------------------------------------------------
from typing import List
# Runtime Complexity: O(N)
# Space Complexity: O(1)
class Solution:
def maxProfit(self, prices: List[int]) -> int:
if len(prices) == 0:
return 0
... | 0 | 0 | 0 | 314 | 0 | 0 | 0 | 2 | 44 |
651987d7de3aff6142ce2f122b6b368e0940755f | 6,839 | py | Python | main.py | GunnarHolwerda/PiWallGuiController | cc90e5f6fd6f13fdfdcabcc8e6b195bf01cb440f | [
"MIT"
] | 5 | 2017-03-29T20:44:42.000Z | 2020-06-26T23:11:34.000Z | main.py | GunnarHolwerda/PiWallGuiController | cc90e5f6fd6f13fdfdcabcc8e6b195bf01cb440f | [
"MIT"
] | null | null | null | main.py | GunnarHolwerda/PiWallGuiController | cc90e5f6fd6f13fdfdcabcc8e6b195bf01cb440f | [
"MIT"
] | 1 | 2021-03-08T14:57:09.000Z | 2021-03-08T14:57:09.000Z | """
GUI Application to control the PiWall from
"""
#!/usr/bin/python3
# Author: Gunnar Holwerda
# GUI to control a PiWall
from tkinter import Tk
# Run the GUI
if __name__ == "__main__":
tk_window = Tk(className="PiWall")
frame = SelectorWindow(master=tk_window)
tk_window.mainloop()
frame.get_con... | 33.360976 | 90 | 0.619389 | """
GUI Application to control the PiWall from
"""
#!/usr/bin/python3
# Author: Gunnar Holwerda
# GUI to control a PiWall
from tkinter import Frame, StringVar, OptionMenu, Listbox, Button, Label, Tk, END
from piwallcontroller.piwallcontroller import PiWallController
from piwallcontroller.playlist import Playlist
f... | 0 | 0 | 0 | 6,276 | 0 | 0 | 0 | 132 | 89 |
4e411687a292bc56a0037b2e523555237471ea26 | 765 | py | Python | libraries/botbuilder-schema/botbuilder/schema/_sign_in_enums.py | victor-kironde/botbuilder-python | e893d9b036d7cf33cf9c9afd1405450c354cdbcd | [
"MIT"
] | 1 | 2020-07-12T21:04:08.000Z | 2020-07-12T21:04:08.000Z | libraries/botbuilder-schema/botbuilder/schema/_sign_in_enums.py | Fortune-Adekogbe/botbuilder-python | 4e48c874c32a2a7fe7f27a7a1f825e2aa39466c4 | [
"MIT"
] | null | null | null | libraries/botbuilder-schema/botbuilder/schema/_sign_in_enums.py | Fortune-Adekogbe/botbuilder-python | 4e48c874c32a2a7fe7f27a7a1f825e2aa39466c4 | [
"MIT"
] | 1 | 2020-10-01T07:34:07.000Z | 2020-10-01T07:34:07.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# ---------------------------------------------------------------------... | 40.263158 | 94 | 0.60915 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# ---------------------------------------------------------------------... | 0 | 0 | 0 | 392 | 0 | 0 | 0 | 0 | 46 |
cedce4854061d9a8c9e7cb1c10204a423754caa1 | 220 | py | Python | verifyage.py | cheesyc/basicpython | 9a055e4f813c6caa601ba00da939439b0bc82a3f | [
"MIT"
] | null | null | null | verifyage.py | cheesyc/basicpython | 9a055e4f813c6caa601ba00da939439b0bc82a3f | [
"MIT"
] | null | null | null | verifyage.py | cheesyc/basicpython | 9a055e4f813c6caa601ba00da939439b0bc82a3f | [
"MIT"
] | null | null | null | from datetime import datetime
# def days (d):
# now = datetime.now
if __name__ == "__main__":
# u = int(input("What is your age?"))
# d = int(input("What month were you born in?"")
print (datetime.now)
| 22 | 52 | 0.613636 | from datetime import datetime
# def days (d):
# now = datetime.now
if __name__ == "__main__":
# u = int(input("What is your age?"))
# d = int(input("What month were you born in?"")
print (datetime.now)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7d5e808698d08d5b754ad10b30667e0affcf369b | 9,023 | py | Python | predictive-horizontal-pod-autoscaler/short/analyse.py | jthomperoo/custom-pod-autoscaler-experiments | f065bee72391dff008a388d46cba40df3fb23c98 | [
"Apache-2.0"
] | 4 | 2020-02-26T14:00:01.000Z | 2022-02-25T15:23:09.000Z | predictive-horizontal-pod-autoscaler/short/analyse.py | jthomperoo/custom-pod-autoscaler-experiments | f065bee72391dff008a388d46cba40df3fb23c98 | [
"Apache-2.0"
] | 1 | 2021-06-12T09:40:56.000Z | 2021-06-12T09:51:45.000Z | predictive-horizontal-pod-autoscaler/short/analyse.py | jthomperoo/custom-pod-autoscaler-experiments | f065bee72391dff008a388d46cba40df3fb23c98 | [
"Apache-2.0"
] | 1 | 2021-07-07T09:58:23.000Z | 2021-07-07T09:58:23.000Z | # Copyright 2020 Jamie Thompson.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 54.355422 | 161 | 0.729469 | # Copyright 2020 Jamie Thompson.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 0 | 0 | 0 | 0 | 0 | 8,167 | 0 | 10 | 226 |
21699970a803f9a1e84a84d986852609b75c11f8 | 2,747 | py | Python | fmformatter/Sites2Query.py | wassermanlab/OpenFlexTyper | 35edbf2c29f20ccec20baaaf46cc2382b7defda6 | [
"MIT"
] | 7 | 2019-11-26T00:01:58.000Z | 2021-04-03T05:31:44.000Z | fmformatter/Sites2Query.py | wassermanlab/OpenFlexTyper_restore | f599011a8f856bd81e73e5472d50980b4695055c | [
"MIT"
] | 33 | 2019-10-22T22:23:51.000Z | 2020-10-02T20:14:17.000Z | fmformatter/Sites2Query.py | wassermanlab/OpenFlexTyper_restore | f599011a8f856bd81e73e5472d50980b4695055c | [
"MIT"
] | 4 | 2019-11-29T23:16:57.000Z | 2020-03-07T19:04:26.000Z |
# Function which takes in a sites file and produces a query file.
# Sites file looks like (these are 1-based coords):
# 22:50988105:G:A
#
# Query file looks like:
# #Index Reference Alternate Chrom Pos Ref Alt Identifier DataType
#0 TTTCTCCAAATACAGATCCAATGTCTTCACTTGTCTATTAAATGCCTCCCATTCCAAATATGATTACCTCTCCCCAGCTCCA... | 41.621212 | 649 | 0.790681 | import pybedtools
import sys
import argparse
def GetArgs():
parser = argparse.ArgumentParser()
parser.add_argument("-I","--Infile",help="Infile in the format of Sites: Chrom:position:ref:alt", required=True)
parser.add_argument("-F","--Fasta",help="Input fasta file corresponding to the positions", required=True)
... | 0 | 0 | 0 | 0 | 0 | 1,466 | 0 | -21 | 157 |
fac204b97e11e17794e1161b7bf560750117f3ce | 49 | py | Python | src/thekpi_node/__init__.py | keeplerteam/thekpi | 082258c26909254caf46caec1da89438a43548c3 | [
"MIT"
] | 2 | 2022-01-21T14:37:50.000Z | 2022-01-21T16:06:27.000Z | src/thekpi_node/__init__.py | keeplerteam/thekpi | 082258c26909254caf46caec1da89438a43548c3 | [
"MIT"
] | null | null | null | src/thekpi_node/__init__.py | keeplerteam/thekpi | 082258c26909254caf46caec1da89438a43548c3 | [
"MIT"
] | null | null | null | from .node import KpiNode
__all__ = ["KpiNode"]
| 12.25 | 25 | 0.714286 | from .node import KpiNode
__all__ = ["KpiNode"]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1fa0e3b8383b8f9f172b6decfb3c6c2eff282ed3 | 4,727 | py | Python | python/Tests/TestStatic.py | ugirumurera/ta_solver | c3bd83633aca4db785a4d0dc554f924bb26754e1 | [
"BSD-3-Clause-LBNL"
] | null | null | null | python/Tests/TestStatic.py | ugirumurera/ta_solver | c3bd83633aca4db785a4d0dc554f924bb26754e1 | [
"BSD-3-Clause-LBNL"
] | null | null | null | python/Tests/TestStatic.py | ugirumurera/ta_solver | c3bd83633aca4db785a4d0dc554f924bb26754e1 | [
"BSD-3-Clause-LBNL"
] | null | null | null | #from Solvers.Decomposition_Solver import Decomposition_Solver
| 41.464912 | 121 | 0.675904 |
import unittest
import numpy as np
from Solvers.Frank_Wolfe_Solver_Static import Frank_Wolfe_Solver
from Solvers.Path_Based_Frank_Wolfe_Solver import Path_Based_Frank_Wolfe_Solver
#from Solvers.Decomposition_Solver import Decomposition_Solver
from Model_Manager.Link_Model_Manager import Link_Model_Manager_class
from ... | 0 | 1,578 | 0 | 2,670 | 0 | 0 | 0 | 192 | 224 |
7c364bc32aba99d22e5967788cc363abdd9e9b31 | 484 | py | Python | api/setup.py | jim8786453/kiln_share | 2d70c8863f7db18069d13cdea319cd113a2d0bbb | [
"BSD-3-Clause"
] | 1 | 2018-03-21T12:27:56.000Z | 2018-03-21T12:27:56.000Z | api/setup.py | jim8786453/kiln_share | 2d70c8863f7db18069d13cdea319cd113a2d0bbb | [
"BSD-3-Clause"
] | null | null | null | api/setup.py | jim8786453/kiln_share | 2d70c8863f7db18069d13cdea319cd113a2d0bbb | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import os
from setuptools import setup
from pip.req import parse_requirements
req_file = 'requirements.txt'
install_reqs = parse_requirements(req_file, session=False)
reqs = [str(ir.req) for ir in install_reqs]
del os.link
setup(
author='Jim Kennedy',
author_email='jim@kohlstudios.co.uk... | 22 | 58 | 0.727273 | #!/usr/bin/env python
import os
import platform
from setuptools import setup
from pip.req import parse_requirements
req_file = 'requirements.txt'
install_reqs = parse_requirements(req_file, session=False)
reqs = [str(ir.req) for ir in install_reqs]
del os.link
setup(
author='Jim Kennedy',
author_email='jim@k... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -6 | 22 |
a7da0dc79993ceee28e11231a75e0d28a5195097 | 784 | py | Python | back/infolica/alembic/versions/20210906_5a8069c68433.py | maltaesousa/infolica | 9b510b706daba8f8a04434d281c1f8730651f25f | [
"MIT"
] | null | null | null | back/infolica/alembic/versions/20210906_5a8069c68433.py | maltaesousa/infolica | 9b510b706daba8f8a04434d281c1f8730651f25f | [
"MIT"
] | 327 | 2019-10-29T13:35:25.000Z | 2022-03-03T10:01:46.000Z | back/infolica/alembic/versions/20210906_5a8069c68433.py | maltaesousa/infolica | 9b510b706daba8f8a04434d281c1f8730651f25f | [
"MIT"
] | 5 | 2019-11-07T15:49:05.000Z | 2021-03-08T08:59:56.000Z | """fix affaire abandon default value
Revision ID: 5a8069c68433
Revises: ee79f1259c77
Create Date: 2021-09-06 16:28:58.437853
"""
# revision identifiers, used by Alembic.
revision = '5a8069c68433'
down_revision = 'ee79f1259c77'
branch_labels = None
depends_on = None
| 25.290323 | 65 | 0.655612 | """fix affaire abandon default value
Revision ID: 5a8069c68433
Revises: ee79f1259c77
Create Date: 2021-09-06 16:28:58.437853
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5a8069c68433'
down_revision = 'ee79f1259c77'
branch_labels = None
depends_on = None
de... | 0 | 0 | 0 | 0 | 0 | 421 | 0 | 3 | 90 |
36df2a65cfecf0f2d8cef146751f1d40789fd2ae | 1,128 | py | Python | Code_Python/Exercicio-03/Leia-três-numeros.py | gabrielf7/code-exercises | b3a8661fadc133395f3c6fb7e926317acf7fa539 | [
"MIT"
] | null | null | null | Code_Python/Exercicio-03/Leia-três-numeros.py | gabrielf7/code-exercises | b3a8661fadc133395f3c6fb7e926317acf7fa539 | [
"MIT"
] | null | null | null | Code_Python/Exercicio-03/Leia-três-numeros.py | gabrielf7/code-exercises | b3a8661fadc133395f3c6fb7e926317acf7fa539 | [
"MIT"
] | null | null | null | #questo 4
num1 = float(input("Digite o primeiro valor: \n"))
num2 = float(input("Digite o segundo valor: \n"))
num3 = float(input("Digite o terceiro valor: \n"))
if(num1 > num2 > num3 or num1 == num2 > num3 or num1 > num2 == num3):
maior = num1
segundo = num2
menor = num3
elif num1 > num2 < num3 or num1 ==... | 31.333333 | 75 | 0.565603 | #questão 4
num1 = float(input("Digite o primeiro valor: \n"))
num2 = float(input("Digite o segundo valor: \n"))
num3 = float(input("Digite o terceiro valor: \n"))
if(num1 > num2 > num3 or num1 == num2 > num3 or num1 > num2 == num3):
maior = num1
segundo = num2
menor = num3
elif num1 > num2 < num3 or num1 =... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ec43363c255f6adb5d1411a40a6f397b07037274 | 383 | py | Python | Economic_Dispatch/plot_results.py | asuncionjc/Pyomo_Playground | b81a12905fb6cdd041b11f89ee4bbbc20168d4d2 | [
"Apache-2.0"
] | 1 | 2019-04-12T14:47:58.000Z | 2019-04-12T14:47:58.000Z | Economic_Dispatch/plot_results.py | asuncionjc/Pyomo_Playground | b81a12905fb6cdd041b11f89ee4bbbc20168d4d2 | [
"Apache-2.0"
] | null | null | null | Economic_Dispatch/plot_results.py | asuncionjc/Pyomo_Playground | b81a12905fb6cdd041b11f89ee4bbbc20168d4d2 | [
"Apache-2.0"
] | 1 | 2021-02-14T18:40:13.000Z | 2021-02-14T18:40:13.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 10 15:53:54 2019
@author: Asun
""" | 25.533333 | 99 | 0.665796 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 10 15:53:54 2019
@author: Asun
"""
import matplotlib.pyplot as plt
import numpy as np
def plot_results(model):
x = np.arange(0, 3)
y = [model.flow[generating_unit,1].value for generating_unit in model.indexes_generating_units]
plt.plot(x, y, color = 'red', m... | 0 | 0 | 0 | 0 | 0 | 226 | 0 | 7 | 68 |
de05130838373479be28ff8059892d8eb6a14633 | 1,787 | py | Python | download_hype.py | woctezuma/steam-hype | cb885f8c1c2a4e7b8d344401207e3a7634f52317 | [
"MIT"
] | 1 | 2019-08-15T18:52:55.000Z | 2019-08-15T18:52:55.000Z | download_hype.py | woctezuma/steam-hype | cb885f8c1c2a4e7b8d344401207e3a7634f52317 | [
"MIT"
] | 10 | 2019-08-15T19:05:10.000Z | 2020-07-24T05:07:28.000Z | download_hype.py | woctezuma/steam-hype | cb885f8c1c2a4e7b8d344401207e3a7634f52317 | [
"MIT"
] | 1 | 2019-08-20T03:32:25.000Z | 2019-08-20T03:32:25.000Z |
if __name__ == '__main__':
main()
| 20.078652 | 75 | 0.604365 | import time
import requests
from utils import save_results
def get_steam_hype_url():
# This is not my API. Please use with moderation!
url = 'https://steamhype-api.herokuapp.com/calendar'
return url
def get_time_stamp():
time_stamp = int(time.time() * 1000)
return time_stamp
def get_steam... | 2 | 0 | 0 | 0 | 0 | 1,541 | 0 | -7 | 206 |
538fa6ef11f1d9c920a5d631b5035786fcade951 | 2,881 | py | Python | examples/sine.py | bjodah/finitediff | bfb1940cf5c7ce5c9a3b440d1efd8f8c4128fed8 | [
"BSD-2-Clause"
] | 27 | 2016-09-14T11:40:35.000Z | 2022-03-05T18:48:26.000Z | examples/sine.py | tutoushaonian/finitediff | bfb1940cf5c7ce5c9a3b440d1efd8f8c4128fed8 | [
"BSD-2-Clause"
] | 4 | 2016-04-08T03:55:14.000Z | 2018-06-27T11:18:58.000Z | examples/sine.py | tutoushaonian/finitediff | bfb1940cf5c7ce5c9a3b440d1efd8f8c4128fed8 | [
"BSD-2-Clause"
] | 5 | 2017-05-25T06:50:40.000Z | 2021-09-13T14:16:59.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function # Python 3 behaviour in Py2
import numpy as np
from finitediff import derivatives_at_point_by_finite_diff, interpolate_by_finite_diff
def demo_usage(n_data=50, n_fit=537, nhead=5, ntail=5, plot=False, alt=0):
"""
... | 30.648936 | 87 | 0.596321 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function # Python 3 behaviour in Py2
import numpy as np
from finitediff import derivatives_at_point_by_finite_diff, interpolate_by_finite_diff
def demo_usage(n_data=50, n_fit=537, nhead=5, ntail=5, plot=False, alt=0):
"""
... | 0 | 0 | 0 | 0 | 0 | 28 | 0 | 0 | 31 |
9271f1a5455a7ecdd71cc83dbca5ba4c204b255a | 1,173 | py | Python | packages/mdspan/package.py | pdidev/spack | 32151f29738895e1f7d96e496c084d6349a9277b | [
"Apache-2.0",
"MIT"
] | 2 | 2020-04-09T11:39:41.000Z | 2021-12-10T17:45:42.000Z | packages/mdspan/package.py | pdidev/spack | 32151f29738895e1f7d96e496c084d6349a9277b | [
"Apache-2.0",
"MIT"
] | 1 | 2021-08-12T10:03:26.000Z | 2021-08-12T10:03:26.000Z | packages/mdspan/package.py | pdidev/spack | 32151f29738895e1f7d96e496c084d6349a9277b | [
"Apache-2.0",
"MIT"
] | 3 | 2020-03-27T15:41:45.000Z | 2022-02-01T15:03:11.000Z | # Copyright (C) 2020 Commissariat a l'energie atomique et aux energies alternatives (CEA)
# and others. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
| 35.545455 | 115 | 0.695652 | # Copyright (C) 2020 Commissariat a l'energie atomique et aux energies alternatives (CEA)
# and others. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Mdspan(CMakePackage):
"""Reference implementation of mdspan targeting C++23."""
hom... | 0 | 0 | 0 | 929 | 0 | 0 | 0 | -2 | 46 |
cdb3f49fb732beb3ef7f5d4eef3c47dfc48b1951 | 307 | py | Python | examples/docs_snippets_crag/docs_snippets_crag/concepts/solids_pipelines/linear_pipeline.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | 1 | 2021-07-03T09:05:58.000Z | 2021-07-03T09:05:58.000Z | examples/docs_snippets_crag/docs_snippets_crag/concepts/solids_pipelines/linear_pipeline.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | 1 | 2021-06-21T18:30:02.000Z | 2021-06-25T21:18:39.000Z | examples/docs_snippets_crag/docs_snippets_crag/concepts/solids_pipelines/linear_pipeline.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | 1 | 2021-09-26T07:29:17.000Z | 2021-09-26T07:29:17.000Z | # pylint: disable=unused-argument
# start_marker
# end_marker
| 13.347826 | 43 | 0.710098 | # pylint: disable=unused-argument
# start_marker
from dagster import pipeline, solid
@solid
def return_one(context) -> int:
return 1
@solid
def add_one(context, number: int) -> int:
return number + 1
@pipeline
def linear_pipeline():
add_one(add_one(add_one(return_one())))
# end_marker
| 0 | 134 | 0 | 0 | 0 | 0 | 0 | 14 | 91 |
ac9f99f6f60b9becd44d5f1c6fefe4639be389b0 | 474 | py | Python | xastropy/relativity/__init__.py | bpholden/xastropy | 66aff0995a84c6829da65996d2379ba4c946dabe | [
"BSD-3-Clause"
] | 3 | 2015-08-23T00:32:58.000Z | 2020-12-31T02:37:52.000Z | xastropy/relativity/__init__.py | Kristall-WangShiwei/xastropy | 723fe56cb48d5a5c4cdded839082ee12ef8c6732 | [
"BSD-3-Clause"
] | 104 | 2015-07-17T18:31:54.000Z | 2018-06-29T17:04:09.000Z | xastropy/relativity/__init__.py | Kristall-WangShiwei/xastropy | 723fe56cb48d5a5c4cdded839082ee12ef8c6732 | [
"BSD-3-Clause"
] | 16 | 2015-07-17T15:50:37.000Z | 2019-04-21T03:42:47.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
""" astropy.cosmology contains classes and functions for cosmological
distance measures and other cosmology-related calculations.
See the `Astropy documentation
<http://docs.astropy.org/en/latest/cosmology/index.html>`_ for more
detailed usage examples an... | 36.461538 | 69 | 0.767932 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
""" astropy.cosmology contains classes and functions for cosmological
distance measures and other cosmology-related calculations.
See the `Astropy documentation
<http://docs.astropy.org/en/latest/cosmology/index.html>`_ for more
detailed usage examples an... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 23 |
4bfa262067e0d0cd970b7cd29211db1db46e96fe | 651 | py | Python | app/migrations/0003_auto_20181022_1601.py | Evohmike/Nyumba-Kumi-App | 80ba9ded12bda6e41c9395a4e439e80f8840d295 | [
"MIT"
] | null | null | null | app/migrations/0003_auto_20181022_1601.py | Evohmike/Nyumba-Kumi-App | 80ba9ded12bda6e41c9395a4e439e80f8840d295 | [
"MIT"
] | null | null | null | app/migrations/0003_auto_20181022_1601.py | Evohmike/Nyumba-Kumi-App | 80ba9ded12bda6e41c9395a4e439e80f8840d295 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-10-22 13:01
from __future__ import unicode_literals
| 25.038462 | 71 | 0.605223 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-10-22 13:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0002_neighbourhood_hood_photo'),
]
operations = [
migrations.AddField(... | 0 | 0 | 0 | 474 | 0 | 0 | 0 | 19 | 46 |
30d1cfa49c2d708d5f169d7bff5b66ab9dc3fbca | 2,138 | py | Python | test_laylib/test_default_engine.py | Layto888/laylib-1.0.1 | c7317c29659a476adf6e90eb729b09ce4c49e219 | [
"MIT"
] | 1 | 2018-08-04T14:44:42.000Z | 2018-08-04T14:44:42.000Z | test_laylib/test_default_engine.py | Layto888/laylib-1.0 | c7317c29659a476adf6e90eb729b09ce4c49e219 | [
"MIT"
] | null | null | null | test_laylib/test_default_engine.py | Layto888/laylib-1.0 | c7317c29659a476adf6e90eb729b09ce4c49e219 | [
"MIT"
] | null | null | null | # test module default_engine.py
import logging
import os
import inspect
import sys
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)
logging.basicConfig(level=logging.INFO,
format='%(leve... | 26.395062 | 87 | 0.755379 | # test module default_engine.py
import pytest
import logging
import os
import inspect
import sys
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)
from laylib import default_engine
logging.basicConfig(level... | 0 | 539 | 0 | 34 | 0 | 715 | 0 | 4 | 252 |
e0296db2c64142c0262d853517a11e247c329f34 | 3,886 | py | Python | lingvo/core/base_decoder.py | pizzahan/lingvo | 9b85b7ba5d037701302efa807841c05223bc7d1d | [
"Apache-2.0"
] | 4 | 2019-06-08T00:19:06.000Z | 2020-08-03T16:28:53.000Z | lingvo/core/base_decoder.py | pizzahan/lingvo | 9b85b7ba5d037701302efa807841c05223bc7d1d | [
"Apache-2.0"
] | null | null | null | lingvo/core/base_decoder.py | pizzahan/lingvo | 9b85b7ba5d037701302efa807841c05223bc7d1d | [
"Apache-2.0"
] | 5 | 2018-12-11T08:05:16.000Z | 2020-05-30T03:40:13.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.728155 | 80 | 0.717962 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 0 | 1,416 | 0 | 1,464 | 0 | 0 | 0 | 60 | 113 |
85d102b6cba4ef055e73d753952668f328b5a301 | 1,225 | py | Python | tests/runtime/asset/test_persistent.py | formlio/forml | fd070da74a0107e37c0c643dd8df8680618fef74 | [
"Apache-2.0"
] | 78 | 2020-11-04T18:27:20.000Z | 2022-02-07T03:32:53.000Z | tests/runtime/asset/test_persistent.py | formlio/forml | fd070da74a0107e37c0c643dd8df8680618fef74 | [
"Apache-2.0"
] | 3 | 2020-11-05T20:42:15.000Z | 2021-01-13T19:57:01.000Z | tests/runtime/asset/test_persistent.py | formlio/forml | fd070da74a0107e37c0c643dd8df8680618fef74 | [
"Apache-2.0"
] | 7 | 2020-11-18T17:18:15.000Z | 2021-03-24T05:14:29.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38.28125 | 120 | 0.75102 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 0 | 0 | 0 | 316 | 0 | 0 | 0 | 10 | 45 |
6929622484867a36adedfe910766d009df4df761 | 491 | py | Python | teste_requests.py | stevillis/gu-escola | 2b26ec53e63fb70447c7a0eb13ab9c6e473122e0 | [
"MIT"
] | null | null | null | teste_requests.py | stevillis/gu-escola | 2b26ec53e63fb70447c7a0eb13ab9c6e473122e0 | [
"MIT"
] | null | null | null | teste_requests.py | stevillis/gu-escola | 2b26ec53e63fb70447c7a0eb13ab9c6e473122e0 | [
"MIT"
] | null | null | null | import requests
BASE_URL = 'http://localhost:8000/api/v2/'
# GET Avaliacoes
"""
response = requests.get(f'{BASE_URL}avaliacoes')
print(response)
print(response.status_code)
avaliacoes = response.json()
print(avaliacoes)
print(avaliacoes.get('count'))
print(avaliacoes.get('results'))
"""
# GET Cursos
headers = {
... | 19.64 | 69 | 0.745418 | import requests
BASE_URL = 'http://localhost:8000/api/v2/'
# GET Avaliacoes
"""
response = requests.get(f'{BASE_URL}avaliacoes')
print(response)
print(response.status_code)
avaliacoes = response.json()
print(avaliacoes)
print(avaliacoes.get('count'))
print(avaliacoes.get('results'))
"""
# GET Cursos
headers = {
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d5b5b6fef388dc9909b4b8f5f7507dcc08300c41 | 4,852 | py | Python | submissions/aartiste/myKMeans.py | dillonpoff/aima-python | 2eadb43f6ede9c7a2e211ea38dff3fa5fd5c91df | [
"MIT"
] | 1 | 2018-08-24T14:04:18.000Z | 2018-08-24T14:04:18.000Z | submissions/aartiste/myKMeans.py | dillonpoff/aima-python | 2eadb43f6ede9c7a2e211ea38dff3fa5fd5c91df | [
"MIT"
] | null | null | null | submissions/aartiste/myKMeans.py | dillonpoff/aima-python | 2eadb43f6ede9c7a2e211ea38dff3fa5fd5c91df | [
"MIT"
] | null | null | null | from sklearn.cluster import KMeans
import traceback
from submissions.aartiste import election
from submissions.aartiste import county_demographics
trumpECHP = DataFrame()
'''
Extract data from the CORGIS elections, and merge it with the
CORGIS demographics. Both data sets are organized by county and state.
'''
joint... | 27.568182 | 99 | 0.620569 | from sklearn.cluster import KMeans
import traceback
from submissions.aartiste import election
from submissions.aartiste import county_demographics
class DataFrame:
data = []
feature_names = []
target = []
target_names = []
trumpECHP = DataFrame()
'''
Extract data from the CORGIS elections, and merge ... | 0 | 0 | 0 | 70 | 0 | 759 | 0 | 0 | 92 |
f45d5ecb43560f81497d317a23712bf1eaf8d15f | 603 | py | Python | initialize_points_w.py | NCBI-Hackathons/McDiff | 43037967e65e8dbdda18c891175c93537b98a238 | [
"MIT"
] | 3 | 2018-06-21T15:16:25.000Z | 2018-06-21T22:42:17.000Z | initialize_points_w.py | NCBI-Hackathons/McDiff | 43037967e65e8dbdda18c891175c93537b98a238 | [
"MIT"
] | null | null | null | initialize_points_w.py | NCBI-Hackathons/McDiff | 43037967e65e8dbdda18c891175c93537b98a238 | [
"MIT"
] | 1 | 2018-06-25T16:17:04.000Z | 2018-06-25T16:17:04.000Z | # import random
# import numpy as np
# numParticles = 120
# point_list = [[0,0],[0,1],[1,1],[1,0]]
# poly = geometry.Polygon(point_list)
# print generate_random_points(numParticles, poly)
| 25.125 | 71 | 0.706468 | from shapely import geometry
# import random
# import numpy as np
# numParticles = 120
# point_list = [[0,0],[0,1],[1,1],[1,0]]
# poly = geometry.Polygon(point_list)
def generate_random_points(N, poly):
list_of_points = np.zeros((2, N))
minx,miny,maxx,maxy = poly.bounds
counter = 0
while counter < N:
punto = (... | 0 | 0 | 0 | 0 | 0 | 360 | 0 | 7 | 45 |
c67cc3624a702cafd7e7246abe8b88132e111d61 | 53 | py | Python | modules/__init__.py | richardHaw/nagare | 4909c4ba8833e7cf5152e39a7bc58a558aaa2c7c | [
"MIT"
] | null | null | null | modules/__init__.py | richardHaw/nagare | 4909c4ba8833e7cf5152e39a7bc58a558aaa2c7c | [
"MIT"
] | null | null | null | modules/__init__.py | richardHaw/nagare | 4909c4ba8833e7cf5152e39a7bc58a558aaa2c7c | [
"MIT"
] | null | null | null | # this file is needed for python2, delete for python3 | 53 | 53 | 0.792453 | # this file is needed for python2, delete for python3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
54cd06ce2ea0585ac5ee273e70cb010a30aa3f06 | 9,713 | py | Python | python/SAGEMAKER_NOTEBOOK_NO_DIRECT_INTERNET_ACCESS/SAGEMAKER_NOTEBOOK_NO_DIRECT_INTERNET_ACCESS_test.py | docebo/aws-config-rules | 75f92bcad644bd71f19bbc15cf99e6d6de6b8227 | [
"CC0-1.0"
] | 1,295 | 2016-03-01T23:06:33.000Z | 2022-03-31T07:17:53.000Z | python/SAGEMAKER_NOTEBOOK_NO_DIRECT_INTERNET_ACCESS/SAGEMAKER_NOTEBOOK_NO_DIRECT_INTERNET_ACCESS_test.py | tied/aws-config-rules | 7c66e109c1225111d2ab8d1811d6e80dea0affcb | [
"CC0-1.0"
] | 287 | 2016-03-01T19:51:43.000Z | 2022-01-06T04:59:55.000Z | python/SAGEMAKER_NOTEBOOK_NO_DIRECT_INTERNET_ACCESS/SAGEMAKER_NOTEBOOK_NO_DIRECT_INTERNET_ACCESS_test.py | tied/aws-config-rules | 7c66e109c1225111d2ab8d1811d6e80dea0affcb | [
"CC0-1.0"
] | 744 | 2016-03-01T18:33:00.000Z | 2022-03-31T18:46:44.000Z | # Copyright 2017-2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fi... | 50.853403 | 182 | 0.724699 | # Copyright 2017-2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fi... | 0 | 326 | 0 | 4,029 | 0 | 4,000 | 0 | -6 | 232 |
0e295a939cb3bb447622e932af4f06083d13ea4b | 75 | py | Python | starling_sim/basemodel/topology/__init__.py | tellae/starling | 56121c728eb5de3dfc77cdf08da89548f3315c87 | [
"CECILL-B"
] | 19 | 2021-02-16T12:32:22.000Z | 2022-01-06T11:16:44.000Z | starling_sim/basemodel/topology/__init__.py | tellae/starling | 56121c728eb5de3dfc77cdf08da89548f3315c87 | [
"CECILL-B"
] | 20 | 2021-01-13T20:58:07.000Z | 2022-03-21T15:53:07.000Z | starling_sim/basemodel/topology/__init__.py | tellae/starling | 56121c728eb5de3dfc77cdf08da89548f3315c87 | [
"CECILL-B"
] | null | null | null | """
This package contains the modules related to simulation topologies
"""
| 18.75 | 66 | 0.773333 | """
This package contains the modules related to simulation topologies
"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7a9c4005ae9ed6fcb141368f64486d286ecf01ed | 3,288 | py | Python | networking_onos/extensions/callback.py | sanghoshin/networking-onos | 2baec5f74e2721e5f8dffd57b3ef7a27034fa54a | [
"Apache-2.0"
] | null | null | null | networking_onos/extensions/callback.py | sanghoshin/networking-onos | 2baec5f74e2721e5f8dffd57b3ef7a27034fa54a | [
"Apache-2.0"
] | null | null | null | networking_onos/extensions/callback.py | sanghoshin/networking-onos | 2baec5f74e2721e5f8dffd57b3ef7a27034fa54a | [
"Apache-2.0"
] | 1 | 2017-10-19T04:23:14.000Z | 2017-10-19T04:23:14.000Z | # Copyright (c) 2017 SK Telecom Ltd
# 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 requir... | 39.614458 | 79 | 0.680961 | # Copyright (c) 2017 SK Telecom Ltd
# 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 requir... | 0 | 0 | 0 | 1,972 | 0 | 0 | 0 | 21 | 45 |
2e38813849e7b8d4b409de57f658a7d182ad66aa | 3,682 | py | Python | play.py | ksu-is/guesswordgame | 65478e24c1fc834e43ab9dd3d00c8429fbe96f22 | [
"Apache-2.0"
] | 7 | 2015-10-03T04:10:57.000Z | 2021-04-02T14:43:21.000Z | play.py | ksu-is/guesswordgame | 65478e24c1fc834e43ab9dd3d00c8429fbe96f22 | [
"Apache-2.0"
] | 1 | 2016-04-20T17:11:22.000Z | 2016-04-26T18:08:23.000Z | play.py | ksu-is/guesswordgame | 65478e24c1fc834e43ab9dd3d00c8429fbe96f22 | [
"Apache-2.0"
] | 5 | 2016-02-26T09:42:48.000Z | 2021-05-09T17:32:04.000Z | import game.main as game
import time
import sys
if __name__ == "__main__":
try:
main()
except (KeyboardInterrupt, SystemExit):
print "\n Recieved Interrupt Signal. Bye...."
import sys
sys.exit()
| 32.017391 | 110 | 0.560565 | import game.main as game
import time
import sys
def main():
play = "--++playtheguesswordgame++--"
if len(sys.argv) > 1 and sys.argv[1] == "tut":
print """
Enter your guess that must be containing 4 letters:
"""
time.sleep(3)
print """
# now the player types... | 0 | 0 | 0 | 0 | 0 | 3,423 | 0 | 0 | 23 |
b7325eaebdbd28f2ed8cbfb180708a24650dee3d | 5,258 | py | Python | mysite/users/models.py | 2021fallCMPUT404/group-cmput404-project | 985b76dc6c554caf77e7cf5788355cca22a26e74 | [
"Apache-2.0"
] | 2 | 2021-12-06T06:42:41.000Z | 2022-03-29T21:40:14.000Z | mysite/users/models.py | 2021fallCMPUT404/group-cmput404-project | 985b76dc6c554caf77e7cf5788355cca22a26e74 | [
"Apache-2.0"
] | 7 | 2021-10-29T20:31:44.000Z | 2021-12-05T06:55:58.000Z | mysite/users/models.py | 2021fallCMPUT404/group-cmput404-project | 985b76dc6c554caf77e7cf5788355cca22a26e74 | [
"Apache-2.0"
] | null | null | null |
SITE_URL = "https://cmput404-socialdist-project.herokuapp.com"
'''
#TODO: MERGE USER_PROFILE INTO USER
class User(AbstractUser):
pass
'''
# Create your models here.
| 38.661765 | 105 | 0.621909 | from django.db import models
from django.contrib.auth.models import User
from django.contrib.auth.models import AbstractUser
from django.http import HttpResponse
import uuid
from django import forms
from django.forms.widgets import Textarea
import datetime
from posts.models import Post, Like, CommentLike#, In... | 0 | 0 | 0 | 4,322 | 0 | 229 | 0 | 118 | 393 |
ff134e64e57b7ca7080b40af0e3f390aa9a3db33 | 1,305 | py | Python | .env/lib/python2.7/site-packages/skimage/viewer/tests/test_utils.py | ViduraPrasangana/faster-rcnn-caffe | af6f5ee89c6e82d295bddd192d9dfcebd60d7c52 | [
"MIT"
] | 1 | 2019-01-12T13:17:32.000Z | 2019-01-12T13:17:32.000Z | .env/lib/python2.7/site-packages/skimage/viewer/tests/test_utils.py | ViduraPrasangana/faster-rcnn-caffe | af6f5ee89c6e82d295bddd192d9dfcebd60d7c52 | [
"MIT"
] | 30 | 2020-04-15T19:37:40.000Z | 2020-04-22T21:19:35.000Z | .env/lib/python2.7/site-packages/skimage/viewer/tests/test_utils.py | ViduraPrasangana/faster-rcnn-caffe | af6f5ee89c6e82d295bddd192d9dfcebd60d7c52 | [
"MIT"
] | 2 | 2020-03-12T23:20:22.000Z | 2021-02-15T21:54:02.000Z | # -*- coding: utf-8 -*-
| 31.071429 | 76 | 0.724904 | # -*- coding: utf-8 -*-
from skimage.viewer import utils
from skimage.viewer.utils import dialogs
from skimage.viewer.qt import QtCore, QtWidgets, has_qt
from skimage._shared import testing
@testing.skipif(not has_qt, reason="Qt not installed")
def test_event_loop():
utils.init_qtapp()
timer = QtCore.QTimer()... | 0 | 1,019 | 0 | 0 | 0 | 0 | 0 | 78 | 180 |
e4eed4150a0020f361e02176075753236176288a | 269 | py | Python | RasaNLU/pending_actions.py | naikshubham/Rasa-Introduction | 93b1c6428879e49ddd93d7a5ec5a4eb52fb9bab2 | [
"BSD-2-Clause"
] | 1 | 2021-06-15T09:58:15.000Z | 2021-06-15T09:58:15.000Z | RasaNLU/pending_actions.py | naikshubham/Rasa-Introduction | 93b1c6428879e49ddd93d7a5ec5a4eb52fb9bab2 | [
"BSD-2-Clause"
] | null | null | null | RasaNLU/pending_actions.py | naikshubham/Rasa-Introduction | 93b1c6428879e49ddd93d7a5ec5a4eb52fb9bab2 | [
"BSD-2-Clause"
] | null | null | null | # Pending actions
# we can improve user experience of our bot by asking the user simple yes or no followup questions
# one easy way to handle these followup is to define pending actions which gets executed as soon as user says "yes"
# and wiped if the user says "no"
| 44.833333 | 115 | 0.769517 | # Pending actions
# we can improve user experience of our bot by asking the user simple yes or no followup questions
# one easy way to handle these followup is to define pending actions which gets executed as soon as user says "yes"
# and wiped if the user says "no"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
28ea666798dad6da46886eee004f74017eb3e201 | 2,573 | py | Python | get_ip_pool.py | vbertcen/ajk_sp_sale_rent_ratio | bd477441fde3ccbe396b68dba2418ec0b9aa558e | [
"Apache-2.0"
] | 1 | 2019-08-30T10:54:06.000Z | 2019-08-30T10:54:06.000Z | get_ip_pool.py | vbertcen/ajk_sp_sale_rent_ratio | bd477441fde3ccbe396b68dba2418ec0b9aa558e | [
"Apache-2.0"
] | null | null | null | get_ip_pool.py | vbertcen/ajk_sp_sale_rent_ratio | bd477441fde3ccbe396b68dba2418ec0b9aa558e | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import sys
import datetime
reload(sys)
sys.setdefaultencoding('utf8')
now_str = datetime.datetime.now().strftime('%Y-%m-%d')
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 OPR/57.0.3098.116", }
if __n... | 34.306667 | 156 | 0.539059 | # coding=utf-8
import sys
import pymysql
import requests
import datetime
from lxml import etree
reload(sys)
sys.setdefaultencoding('utf8')
now_str = datetime.datetime.now().strftime('%Y-%m-%d')
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.... | 27 | 0 | 0 | 0 | 0 | 2,103 | 0 | -12 | 113 |
dd8bdd0ca9cd34cb385f46afc75b4e9cf95ab521 | 476 | py | Python | jython/jython/java_usage_examples.py | JohannesDienst/polyglot_integration | ee0936539282e82d4d0605ed564389c0539ede40 | [
"MIT"
] | null | null | null | jython/jython/java_usage_examples.py | JohannesDienst/polyglot_integration | ee0936539282e82d4d0605ed564389c0539ede40 | [
"MIT"
] | null | null | null | jython/jython/java_usage_examples.py | JohannesDienst/polyglot_integration | ee0936539282e82d4d0605ed564389c0539ede40 | [
"MIT"
] | null | null | null | from java.lang import System as javasystem
javasystem.out.println("Hello")
from java.util import Random
r = rand(100, 23)
for i in range(10):
print r.nextDouble() | 23.8 | 56 | 0.653361 | from java.lang import System as javasystem
javasystem.out.println("Hello")
from java.util import Random
class rand(Random):
def __init__(self, multiplier=1.0, seed=None):
self.multiplier = multiplier
if seed is None:
Random.__init__(self)
else:
Random.__init__(self... | 0 | 0 | 0 | 284 | 0 | 0 | 0 | 0 | 23 |
da4b679b11109485dccab6378be56da7adfaca21 | 321 | py | Python | 5-loops/exercise_3.1.py | wgatharia/csci131 | 50d76603863c9a9932634fdf2e48594f8dc673d2 | [
"MIT"
] | null | null | null | 5-loops/exercise_3.1.py | wgatharia/csci131 | 50d76603863c9a9932634fdf2e48594f8dc673d2 | [
"MIT"
] | null | null | null | 5-loops/exercise_3.1.py | wgatharia/csci131 | 50d76603863c9a9932634fdf2e48594f8dc673d2 | [
"MIT"
] | null | null | null | """
File: exercise_3.1.py
Author: William Gatharia
This code demonstrates using a for loop.
"""
#loop and print numbers from 1 to 10 using a for loop and range
# range creates a list of numbers
# starting from 1 to 10.
# Note the 11 = 10 + 1 is the upper limit form range
for i in range(1, 11):
print(i)
... | 24.692308 | 63 | 0.682243 | """
File: exercise_3.1.py
Author: William Gatharia
This code demonstrates using a for loop.
"""
#loop and print numbers from 1 to 10 using a for loop and range
# range creates a list of numbers
# starting from 1 to 10.
# Note the 11 = 10 + 1 is the upper limit form range
for i in range(1, 11):
print(i)
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cd438ed3e070272f3b23e2778ba9493fd02837f8 | 1,919 | py | Python | Data_preparation/test/video_subcrop.py | Rukaume/LRCN | 0d1928cc72544f59a4335fea7febc561d3dfc118 | [
"MIT"
] | 1 | 2020-11-07T05:57:32.000Z | 2020-11-07T05:57:32.000Z | Data_preparation/test/video_subcrop.py | Rukaume/LRCN | 0d1928cc72544f59a4335fea7febc561d3dfc118 | [
"MIT"
] | 1 | 2020-11-07T00:30:22.000Z | 2021-01-26T02:22:16.000Z | Data_preparation/test/video_subcrop.py | Rukaume/LRCN | 0d1928cc72544f59a4335fea7febc561d3dfc118 | [
"MIT"
] | 1 | 2020-11-07T05:57:52.000Z | 2020-11-07T05:57:52.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 27 21:19:37 2020
@author: miyazakishinichi
"""
from tkinter import messagebox
from tkinter import filedialog
import tkinter
import os, sys, cv2
from tqdm import tqdm
####Tk root generate####
root = tkinter.Tk()
root.withdraw()
####ROI sett... | 27.028169 | 71 | 0.668056 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 27 21:19:37 2020
@author: miyazakishinichi
"""
import pandas as pd
from tkinter import messagebox
from tkinter import filedialog
import tkinter
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
import os, sys, cv2
from tq... | 0 | 0 | 0 | 0 | 0 | 310 | 0 | 7 | 112 |
aedaa1eb60c8454a5adaa3d060aa87eba4684ba7 | 207 | py | Python | getFrame.py | divakar-lakhera/Partial-Encryption | 0fc6537b4a23848b21618e906a22920bd00b7c41 | [
"MIT"
] | null | null | null | getFrame.py | divakar-lakhera/Partial-Encryption | 0fc6537b4a23848b21618e906a22920bd00b7c41 | [
"MIT"
] | null | null | null | getFrame.py | divakar-lakhera/Partial-Encryption | 0fc6537b4a23848b21618e906a22920bd00b7c41 | [
"MIT"
] | null | null | null |
import cv2
INPUT_FILE='input_encode.avi'
FRAME_NUMBER=70
cap=cv2.VideoCapture(INPUT_FILE)
cap.set(cv2.CAP_PROP_POS_FRAMES, FRAME_NUMBER)
ret,frame=cap.read()
cv2.imwrite("frame_"+INPUT_FILE+".png",frame)
| 18.818182 | 46 | 0.797101 |
import cv2
INPUT_FILE='input_encode.avi'
FRAME_NUMBER=70
cap=cv2.VideoCapture(INPUT_FILE)
cap.set(cv2.CAP_PROP_POS_FRAMES, FRAME_NUMBER)
ret,frame=cap.read()
cv2.imwrite("frame_"+INPUT_FILE+".png",frame)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
78169f18b371e12087115a1c033f6919a0a32815 | 27,978 | py | Python | brainda/algorithms/decomposition/csp.py | TBC-TJU/MetaBCI-brainda | d2dc655163b771ca22e43432d886ece3d98235c8 | [
"MIT"
] | null | null | null | brainda/algorithms/decomposition/csp.py | TBC-TJU/MetaBCI-brainda | d2dc655163b771ca22e43432d886ece3d98235c8 | [
"MIT"
] | null | null | null | brainda/algorithms/decomposition/csp.py | TBC-TJU/MetaBCI-brainda | d2dc655163b771ca22e43432d886ece3d98235c8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Authors: Swolf <swolfforever@gmail.com>
# Date: 2021/1/07
# License: MIT License
"""
Common Spatial Patterns and his happy little buddies!
"""
from typing import Tuple
import numpy as np
from numpy import ndarray
from scipy.linalg import eigh
from .base import robust_pattern
from ..utils.... | 36.240933 | 315 | 0.589356 | # -*- coding: utf-8 -*-
#
# Authors: Swolf <swolfforever@gmail.com>
# Date: 2021/1/07
# License: MIT License
"""
Common Spatial Patterns and his happy little buddies!
"""
from copy import deepcopy
from typing import Union, Optional, List, Dict, Tuple
from functools import partial
import numpy as np
from numpy import ... | 9 | 0 | 0 | 10,331 | 0 | 0 | 0 | 301 | 313 |
a213ac945ac3eff393596fccbd49623779d35895 | 16,917 | py | Python | teller/explainer/explainer.py | Techtonique/teller | 3571353b843179335e3995a0128d4a0c54c2b905 | [
"BSD-3-Clause-Clear"
] | 5 | 2021-07-14T11:57:36.000Z | 2022-03-26T19:47:54.000Z | teller/explainer/explainer.py | Techtonique/teller | 3571353b843179335e3995a0128d4a0c54c2b905 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-12-21T17:53:37.000Z | 2022-01-26T11:36:32.000Z | teller/explainer/explainer.py | Techtonique/teller | 3571353b843179335e3995a0128d4a0c54c2b905 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-12-21T17:51:00.000Z | 2021-12-21T17:51:00.000Z | import matplotlib.style as style
| 32.284351 | 131 | 0.435952 | import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.style as style
from sklearn.base import BaseEstimator
from ..utils import (
is_factor,
numerical_gradient,
numerical_gradient_jackknife,
numerical_gradient_gaussian,
numerical_interactions,... | 30 | 0 | 0 | 16,418 | 0 | 0 | 0 | 294 | 159 |
70d25e9deb9ce5482aecfe92367ea925fc132f5b | 4,271 | py | Python | script/extract_spotting_area.py | jingyonghou/XY_QByE_STD | ca2a07c70ea7466ee363cd0b81808c6794a400e5 | [
"Apache-2.0"
] | null | null | null | script/extract_spotting_area.py | jingyonghou/XY_QByE_STD | ca2a07c70ea7466ee363cd0b81808c6794a400e5 | [
"Apache-2.0"
] | null | null | null | script/extract_spotting_area.py | jingyonghou/XY_QByE_STD | ca2a07c70ea7466ee363cd0b81808c6794a400e5 | [
"Apache-2.0"
] | 1 | 2020-07-28T06:02:03.000Z | 2020-07-28T06:02:03.000Z | import sys
if __name__=="__main__":
if len(sys.argv) < 7:
print("USAGE: python %s result_dir keywordlist testlist testscp textfile ourdir"%sys.argv[0])
exit(1)
result_dir = sys.argv[1]
keywordlist = open(sys.argv[2]).readlines()
testlist = open(sys.argv[3]).readlines()
doc_sc... | 36.818966 | 199 | 0.618356 | import numpy as np
import sys
import wavedata
import random
import os
def relevant(query, text_id, relevant_dict):
if text_id in relevant_dict[query]:
return True
return False
def build_relevant_dict(text_file):
relevant_dict = {}
for line in open(text_file).readlines():
fields = line.... | 0 | 0 | 0 | 0 | 0 | 2,873 | 0 | -29 | 204 |
271deb29b66fe4e4014e52baf2d9509cf8f631f6 | 427 | py | Python | src/smallest_integer.py | marco-zangari/code-katas | 1dfda1cfbbe8687b17e97e414358b38d964df675 | [
"MIT"
] | null | null | null | src/smallest_integer.py | marco-zangari/code-katas | 1dfda1cfbbe8687b17e97e414358b38d964df675 | [
"MIT"
] | null | null | null | src/smallest_integer.py | marco-zangari/code-katas | 1dfda1cfbbe8687b17e97e414358b38d964df675 | [
"MIT"
] | null | null | null | """Find the smallest integer in the array, Kata in Codewars."""
def smallest(alist):
"""Return the smallest integer in the list.
input: a list of integers
output: a single integer
ex: [34, 15, 88, 2] should return 34
ex: [34, -345, -1, 100] should return -345
"""
res = [alist[0]]
for ... | 23.722222 | 63 | 0.569087 | """Find the smallest integer in the array, Kata in Codewars."""
def smallest(alist):
"""Return the smallest integer in the list.
input: a list of integers
output: a single integer
ex: [34, 15, 88, 2] should return 34
ex: [34, -345, -1, 100] should return -345
"""
res = [alist[0]]
for ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e3f4e7de367fe4adbb1c08ed45342cc24a82354b | 1,810 | py | Python | extract-code.py | aaw/commafree | 6ee17fdf1e7858546782f81b1f004659c03661d3 | [
"Unlicense"
] | null | null | null | extract-code.py | aaw/commafree | 6ee17fdf1e7858546782f81b1f004659c03661d3 | [
"Unlicense"
] | null | null | null | extract-code.py | aaw/commafree | 6ee17fdf1e7858546782f81b1f004659c03661d3 | [
"Unlicense"
] | null | null | null | #!/usr/bin/python3
# Extracts a commafree code from a CNF file created by commafree.py and
# the output of a SAT solver on that CNF file. Only works on satisfiable
# instances.
#
# Usage: extract-code.py <cnf-file> <sat-solver-output-file>
import sys
if __name__ == '__main__':
if len(sys.argv) < 3:
print(... | 31.754386 | 78 | 0.570718 | #!/usr/bin/python3
# Extracts a commafree code from a CNF file created by commafree.py and
# the output of a SAT solver on that CNF file. Only works on satisfiable
# instances.
#
# Usage: extract-code.py <cnf-file> <sat-solver-output-file>
import re
import sys
def strip_cnf_mapping(filename):
# lines look like '... | 0 | 0 | 0 | 0 | 0 | 1,004 | 0 | -12 | 92 |
6496c26b86b5e1c0f0f3e63c148cc42bb42f3e84 | 22,361 | py | Python | chrome/test/functional/autofill.py | meego-tablet-ux/meego-app-browser | 0f4ef17bd4b399c9c990a2f6ca939099495c2b9c | [
"BSD-3-Clause"
] | 1 | 2015-10-12T09:14:22.000Z | 2015-10-12T09:14:22.000Z | chrome/test/functional/autofill.py | meego-tablet-ux/meego-app-browser | 0f4ef17bd4b399c9c990a2f6ca939099495c2b9c | [
"BSD-3-Clause"
] | null | null | null | chrome/test/functional/autofill.py | meego-tablet-ux/meego-app-browser | 0f4ef17bd4b399c9c990a2f6ca939099495c2b9c | [
"BSD-3-Clause"
] | 1 | 2020-11-04T07:22:28.000Z | 2020-11-04T07:22:28.000Z | #!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import pyauto_functional # Must be imported before pyauto
if __name__ == '__main__':
pyauto_functional.Main()
| 45.449187 | 80 | 0.653414 | #!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import pickle
import re
import autofill_dataset_converter
import autofill_dataset_generator
import pyauto_fun... | 0 | 0 | 0 | 21,905 | 0 | 0 | 0 | -23 | 179 |
d1839a3279a5cf65bd5fa7efd4fde3026ed8d45c | 9,871 | py | Python | ke/images/python/cluster_tool.py | justasabc/kubernetes-ubuntu | afc670297a5becb2fcb4404c3ee1e02c99b5eaf4 | [
"Apache-2.0"
] | 1 | 2020-10-18T01:34:39.000Z | 2020-10-18T01:34:39.000Z | ke/images/python/cluster_tool.py | justasabc/kubernetes-ubuntu | afc670297a5becb2fcb4404c3ee1e02c99b5eaf4 | [
"Apache-2.0"
] | null | null | null | ke/images/python/cluster_tool.py | justasabc/kubernetes-ubuntu | afc670297a5becb2fcb4404c3ee1e02c99b5eaf4 | [
"Apache-2.0"
] | null | null | null | """
Class Hierarchy
G{classtree: BaseTool}
Package tree
G{packagetree: cluster_tool}
Import Graph
G{importgraph: cluster_tool}
"""
#/usr/bin/python
# -*- coding:utf-8 -*-
DOCKER_SERVER_URL = 'tcp://master:2375'
if __name__=="__main__":
main()
| 34.757042 | 141 | 0.668727 | """
Class Hierarchy
G{classtree: BaseTool}
Package tree
G{packagetree: cluster_tool}
Import Graph
G{importgraph: cluster_tool}
"""
#/usr/bin/python
# -*- coding:utf-8 -*-
import subprocess
from json_generator import JsonGenerator
from container_client import ContainerClient
DOCKER_SERVER_URL = 'tcp://master:23... | 0 | 0 | 0 | 9,166 | 0 | 209 | 0 | 38 | 205 |
4311beaaf96391f1dec77dcb15a6c9c8eec39f67 | 239 | py | Python | cli/__init__.py | Polsaker/throat | 39fd66efb7251f1607d9bf9e407e0cbbdfc10c57 | [
"MIT"
] | 8 | 2019-05-27T19:34:25.000Z | 2020-03-01T19:06:48.000Z | cli/__init__.py | Polsaker/throat | 39fd66efb7251f1607d9bf9e407e0cbbdfc10c57 | [
"MIT"
] | null | null | null | cli/__init__.py | Polsaker/throat | 39fd66efb7251f1607d9bf9e407e0cbbdfc10c57 | [
"MIT"
] | 7 | 2019-05-29T17:12:40.000Z | 2020-05-01T16:41:16.000Z | from .recount import recount
from .admin import admin
from .default import default
from .migration import migration
from .translations import translations
commands = [
migration,
recount,
admin,
default,
translations
]
| 18.384615 | 38 | 0.74477 | from .recount import recount
from .admin import admin
from .default import default
from .migration import migration
from .translations import translations
commands = [
migration,
recount,
admin,
default,
translations
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
500d465798a7caedef8ae7ce212b2a7ab666165d | 1,078 | py | Python | madrona/common/assets.py | movermeyer/madrona | fcdced0a03408754b88a3d88f416e04d500c32d4 | [
"BSD-3-Clause"
] | 9 | 2015-03-09T11:04:21.000Z | 2022-01-16T09:45:36.000Z | madrona/common/assets.py | movermeyer/madrona | fcdced0a03408754b88a3d88f416e04d500c32d4 | [
"BSD-3-Clause"
] | 1 | 2020-04-24T14:38:43.000Z | 2020-04-24T14:38:43.000Z | madrona/common/assets.py | movermeyer/madrona | fcdced0a03408754b88a3d88f416e04d500c32d4 | [
"BSD-3-Clause"
] | 2 | 2016-12-06T15:31:35.000Z | 2018-03-04T20:04:44.000Z | from elementtree import ElementTree as et
import os
ROOT_PATH = ''
def get_js_files():
"""Returns a list of all the javascript files listed in
media/js_includes.xml"""
files = []
path = os.path.dirname(os.path.abspath(__file__))
tree = et.parse(path + '/../media/js_includes.xml')
for f in tre... | 30.8 | 65 | 0.646568 | from elementtree import ElementTree as et
import os
ROOT_PATH = ''
def get_js_files():
"""Returns a list of all the javascript files listed in
media/js_includes.xml"""
files = []
path = os.path.dirname(os.path.abspath(__file__))
tree = et.parse(path + '/../media/js_includes.xml')
for f in tre... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
48a887f207778a7c4e05b2e0a8a7e32643674841 | 1,018 | py | Python | tests/conf/config.py | robert-werner/fastapi-crudrouter | 4f924307b53e5ea1adaa509302800c060ee7d06a | [
"MIT"
] | null | null | null | tests/conf/config.py | robert-werner/fastapi-crudrouter | 4f924307b53e5ea1adaa509302800c060ee7d06a | [
"MIT"
] | null | null | null | tests/conf/config.py | robert-werner/fastapi-crudrouter | 4f924307b53e5ea1adaa509302800c060ee7d06a | [
"MIT"
] | null | null | null | import pathlib
ENV_FILE_PATH = pathlib.Path(__file__).parent / "dev.env"
assert ENV_FILE_PATH.exists()
| 27.513514 | 150 | 0.574656 | import os
import pathlib
ENV_FILE_PATH = pathlib.Path(__file__).parent / "dev.env"
assert ENV_FILE_PATH.exists()
class BaseConfig:
POSTGRES_HOST = ""
POSTGRES_USER = ""
POSTGRES_PASSWORD = ""
POSTGRES_DB = ""
POSTGRES_PORT = ""
def __init__(self):
self._apply_dot_env()
self.... | 0 | 0 | 0 | 879 | 0 | 0 | 0 | -12 | 45 |
530a06fbf60cdea98dfb1c9085cf498b370520c5 | 3,958 | py | Python | .2lanemdr/2lanemdr.py | hemidactylus/nbws1 | 282cc2f0d5c04f5fc818f3e411dfb5b549ea47f6 | [
"Apache-2.0"
] | null | null | null | .2lanemdr/2lanemdr.py | hemidactylus/nbws1 | 282cc2f0d5c04f5fc818f3e411dfb5b549ea47f6 | [
"Apache-2.0"
] | null | null | null | .2lanemdr/2lanemdr.py | hemidactylus/nbws1 | 282cc2f0d5c04f5fc818f3e411dfb5b549ea47f6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import re
import os
import json
import subprocess
DEF_FILE = '.2lane.info'
DIRECTIVE_TEMPLATE = '<!-- 2L {body} -->'
TYPO_WARNING_FINDER = re.compile('\W2L\W', re.IGNORECASE)
MESSAGE_TEMPLATE = '** 2lanemdr {kind} on {filename}:{linenumber} "{message}"'
def parseDirective(line, wrcs):
"""
... | 29.984848 | 80 | 0.490904 | #!/usr/bin/python
import re
import os
import sys
import json
import subprocess
DEF_FILE = '.2lane.info'
DIRECTIVE_TEMPLATE = '<!-- 2L {body} -->'
TYPO_WARNING_FINDER = re.compile('\W2L\W', re.IGNORECASE)
MESSAGE_TEMPLATE = '** 2lanemdr {kind} on {filename}:{linenumber} "{message}"'
def parseDirective(line, wrcs):
... | 0 | 0 | 0 | 0 | 0 | 525 | 0 | -11 | 92 |