hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c1964cd5e9176d214e424526a7cf5144a4f60c1 | 107 | py | Python | python/antelope/gen3/__init__.py | omry/addax | e1a8de6c88bd6828f9f7435b07cd4e1a537a3894 | [
"MIT"
] | null | null | null | python/antelope/gen3/__init__.py | omry/addax | e1a8de6c88bd6828f9f7435b07cd4e1a537a3894 | [
"MIT"
] | 1 | 2019-07-21T06:11:51.000Z | 2019-07-21T06:11:51.000Z | python/antelope/gen3/__init__.py | omry/antelope | e1a8de6c88bd6828f9f7435b07cd4e1a537a3894 | [
"MIT"
] | null | null | null | from .YAMLLexer import YAMLLexer
from .YAMLParser import YAMLParser
from .YAMLListener import YAMLListener
| 26.75 | 38 | 0.859813 | from .YAMLLexer import YAMLLexer
from .YAMLParser import YAMLParser
from .YAMLListener import YAMLListener
| true | true |
1c1965aa70c8633105518efe839079ca3fffa3e6 | 5,331 | py | Python | logit/01logit.py | mwong009/santander-rbm | 4d0c58cecac61d1e827d2b72734233fbb2104375 | [
"MIT"
] | null | null | null | logit/01logit.py | mwong009/santander-rbm | 4d0c58cecac61d1e827d2b72734233fbb2104375 | [
"MIT"
] | null | null | null | logit/01logit.py | mwong009/santander-rbm | 4d0c58cecac61d1e827d2b72734233fbb2104375 | [
"MIT"
] | null | null | null | ########################################
#
# @file 01logit.py
# @author: Michel Bierlaire, EPFL
# @date: Wed Dec 21 13:23:27 2011
#
#######################################
from biogeme import *
from headers import *
from loglikelihood import *
from statistics import *
import numpy as np
#Parameters to... | 41.325581 | 191 | 0.618458 | newcs = [Beta('b_newcs' + format(n, '02d'),0,-10,10,0,'new cust.')
for n,ch in enumerate(asc)]
b_resid = [Beta('b_resid' + format(n, '02d'),0,-10,10,0,'resident')
for n,ch in enumerate(asc)]
b_forgn = [Beta('b_forgn' + format(n, '02d'),0,-10,10,0,'foreigner')
for n,ch in enumerate(... | true | true |
1c1965bcebb0e3be481e3a37601440d8e3ce5c94 | 607 | py | Python | plotly/validators/barpolar/marker/colorbar/tickfont/_family.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/barpolar/marker/colorbar/tickfont/_family.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/barpolar/marker/colorbar/tickfont/_family.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name='family',
parent_name='barpolar.marker.colorbar.tickfont',
**kwargs
):
super(FamilyValidator, self).__init__(
plotly_nam... | 28.904762 | 68 | 0.60626 | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name='family',
parent_name='barpolar.marker.colorbar.tickfont',
**kwargs
):
super(FamilyValidator, self).__init__(
plotly_nam... | true | true |
1c1966e8ef26bdda3cf3666d1ea68b3c24d786c6 | 362 | py | Python | py/examples/form_frame.py | dethnass/wave | 9c82d3f50966c9cb24fae85e7c02b5df148e467e | [
"Apache-2.0"
] | 1 | 2021-03-01T01:12:45.000Z | 2021-03-01T01:12:45.000Z | py/examples/form_frame.py | dethnass/wave | 9c82d3f50966c9cb24fae85e7c02b5df148e467e | [
"Apache-2.0"
] | 6 | 2022-02-15T01:36:20.000Z | 2022-02-27T23:42:25.000Z | py/examples/form_frame.py | dethnass/wave | 9c82d3f50966c9cb24fae85e7c02b5df148e467e | [
"Apache-2.0"
] | 2 | 2021-01-08T17:58:32.000Z | 2021-03-19T21:55:24.000Z | # Form / Frame
# Use a frame component in a form card to display HTML content inline.
# ---
from h2o_wave import site, ui
html = '''
<!DOCTYPE html>
<html>
<body>
<h1>Hello World!</h1>
</body>
</html>
'''
page = site['/demo']
page['example'] = ui.form_card(
box='1 1 2 2',
items=[
ui.frame(content=h... | 14.48 | 70 | 0.596685 |
from h2o_wave import site, ui
html = '''
<!DOCTYPE html>
<html>
<body>
<h1>Hello World!</h1>
</body>
</html>
'''
page = site['/demo']
page['example'] = ui.form_card(
box='1 1 2 2',
items=[
ui.frame(content=html, height='100px')
]
)
page.save()
| true | true |
1c196773d1af6a4529c33ee1870743b2d5d73dec | 253 | py | Python | codeforces/math数学/900/1163A喝汤猫咪.py | yofn/pyacm | e573f8fdeea77513711f00c42f128795cbba65a6 | [
"Apache-2.0"
] | null | null | null | codeforces/math数学/900/1163A喝汤猫咪.py | yofn/pyacm | e573f8fdeea77513711f00c42f128795cbba65a6 | [
"Apache-2.0"
] | null | null | null | codeforces/math数学/900/1163A喝汤猫咪.py | yofn/pyacm | e573f8fdeea77513711f00c42f128795cbba65a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# https://codeforces.com/problemset/problem/1163/A
# n,m 最多几组..
# 1. 看还剩多少人..组数<=人数
# 2. 看能截断几次..截断2次=2组
def f(l):
n,m = l
if m<2:
return 1
return min(m,n-m)
l = list(map(int,input().split()))
print(f(l))
| 14.882353 | 50 | 0.573123 |
def f(l):
n,m = l
if m<2:
return 1
return min(m,n-m)
l = list(map(int,input().split()))
print(f(l))
| true | true |
1c1968109ca08057fa4756b2d61aed2dd5af7696 | 3,042 | py | Python | venv/Lib/site-packages/pyrogram/raw/types/messages/affected_history.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/types/messages/affected_history.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/messages/affected_history.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 33.065217 | 104 | 0.614398 |
from io import BytesIO
from pyrogram.raw.core.primitives import Int, Long, Int128, Int256, Bool, Bytes, String, Double, Vector
from pyrogram.raw.core import TLObject
from pyrogram import raw
from typing import List, Union, Any
| true | true |
1c19697b1b2b25f3470fcc2b191a79c1d476c879 | 1,019 | py | Python | hindex/terms.py | akx/hindex | 03f4966f2d599a634e11241e73773dc723a2b69f | [
"MIT"
] | null | null | null | hindex/terms.py | akx/hindex | 03f4966f2d599a634e11241e73773dc723a2b69f | [
"MIT"
] | null | null | null | hindex/terms.py | akx/hindex | 03f4966f2d599a634e11241e73773dc723a2b69f | [
"MIT"
] | null | null | null | import re
from typing import Iterable
from nltk.corpus import stopwords
from hindex.models import TermWithMatch, Term
from hindex.utils import punc_remove_re, strip_set
def normalize_term(term, language):
term = term.lower()
if language == "english":
term = re.sub("'s$", "", term)
term = punc_re... | 26.128205 | 79 | 0.662414 | import re
from typing import Iterable
from nltk.corpus import stopwords
from hindex.models import TermWithMatch, Term
from hindex.utils import punc_remove_re, strip_set
def normalize_term(term, language):
term = term.lower()
if language == "english":
term = re.sub("'s$", "", term)
term = punc_re... | true | true |
1c1969b4ca485f6012c250f1ca1fab75ce07ebba | 6,300 | py | Python | nova/api/openstack/compute/contrib/baremetal_nodes.py | bopopescu/nested_quota_final | 7c3454883de9f5368fa943924540eebe157a319d | [
"Apache-2.0"
] | 5 | 2017-06-23T07:37:39.000Z | 2020-10-21T07:07:50.000Z | nova/api/openstack/compute/contrib/baremetal_nodes.py | bopopescu/nested_quota_final | 7c3454883de9f5368fa943924540eebe157a319d | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/contrib/baremetal_nodes.py | bopopescu/nested_quota_final | 7c3454883de9f5368fa943924540eebe157a319d | [
"Apache-2.0"
] | 4 | 2017-06-23T07:37:43.000Z | 2020-12-28T09:57:22.000Z | # Copyright (c) 2013 NTT DOCOMO, 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 requ... | 35.195531 | 78 | 0.62127 |
from oslo_config import cfg
from oslo_utils import importutils
import webob
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.i18n import _
from nova.openstack.common import log as logging
ironic_client = importutils.try_import('ironicclient.client')
authorize = ... | true | true |
1c196a8ed99a0da475150f3e9ca0c66b08656053 | 11,071 | py | Python | Lib/gzip.py | 1byte2bytes/cpython | 7fbaeb819ca7b20dca048217ff585ec195e999ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | 1 | 2019-10-25T21:41:07.000Z | 2019-10-25T21:41:07.000Z | Lib/gzip.py | 1byte2bytes/cpython | 7fbaeb819ca7b20dca048217ff585ec195e999ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | null | null | null | Lib/gzip.py | 1byte2bytes/cpython | 7fbaeb819ca7b20dca048217ff585ec195e999ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | null | null | null | import time
import string
import zlib
import struct
import __builtin__
# implements a python function that reads and writes a gzipped file
# the user of the file doesn't have to worry about the compression,
# but random access is not allowed
# based on Andrew Kuchling's minigzip.py distributed with the zlib module
F... | 33.146707 | 79 | 0.526872 | import time
import string
import zlib
import struct
import __builtin__
# but random access is not allowed
# based on Andrew Kuchling's minigzip.py distributed with the zlib module
FTEXT, FHCRC, FEXTRA, FNAME, FCOMMENT = 1, 2, 4, 8, 16
READ, WRITE = 1, 2
def write32(output, value):
output.write(struct.pack("<... | false | true |
1c196b182f65f7ec1e430c1061544a603d8398af | 84,293 | py | Python | workalendar/tests/test_europe.py | SeitaBV/workalendar | 57e16a1c96d4f4146d1f0afbd19684bdfa312876 | [
"MIT"
] | null | null | null | workalendar/tests/test_europe.py | SeitaBV/workalendar | 57e16a1c96d4f4146d1f0afbd19684bdfa312876 | [
"MIT"
] | null | null | null | workalendar/tests/test_europe.py | SeitaBV/workalendar | 57e16a1c96d4f4146d1f0afbd19684bdfa312876 | [
"MIT"
] | null | null | null | from datetime import date, timedelta
from collections import Counter
from . import GenericCalendarTest
from ..europe import (
Austria,
Bulgaria,
Belarus,
Belgium,
CaymanIslands,
Croatia,
Cyprus,
CzechRepublic,
Denmark,
Slovakia,
Finland,
Estonia,
Sweden,
France, ... | 45.539168 | 79 | 0.629246 | from datetime import date, timedelta
from collections import Counter
from . import GenericCalendarTest
from ..europe import (
Austria,
Bulgaria,
Belarus,
Belgium,
CaymanIslands,
Croatia,
Cyprus,
CzechRepublic,
Denmark,
Slovakia,
Finland,
Estonia,
Sweden,
France, ... | true | true |
1c196bb27f15a06305b449b289cfb51415691cf4 | 176 | py | Python | evennia/contrib/rpg/dice/__init__.py | davidrideout/evennia | 879eea55acdf4fe5cdc96ba8fd0ab5ccca4ae84b | [
"BSD-3-Clause"
] | null | null | null | evennia/contrib/rpg/dice/__init__.py | davidrideout/evennia | 879eea55acdf4fe5cdc96ba8fd0ab5ccca4ae84b | [
"BSD-3-Clause"
] | null | null | null | evennia/contrib/rpg/dice/__init__.py | davidrideout/evennia | 879eea55acdf4fe5cdc96ba8fd0ab5ccca4ae84b | [
"BSD-3-Clause"
] | null | null | null | """
Rolling dice - Griatch, 2012
"""
from .dice import roll # noqa
from .dice import roll_dice # noqa
from .dice import CmdDice # noqa
from .dice import DiceCmdSet # noqa
| 17.6 | 35 | 0.704545 |
from .dice import roll
from .dice import roll_dice
from .dice import CmdDice
from .dice import DiceCmdSet
| true | true |
1c196be636233a5178c1be56260553541590b4b3 | 2,929 | py | Python | src/py-ds-local/nightjar_ds_local/tests/main_test.py | groboclown/nightjar-mesh | 3655307b4a0ad00a0f18db835b3a0d04cb8e9615 | [
"MIT"
] | 3 | 2019-12-23T23:46:02.000Z | 2020-08-07T23:10:20.000Z | src/py-ds-local/nightjar_ds_local/tests/main_test.py | groboclown/nightjar-mesh | 3655307b4a0ad00a0f18db835b3a0d04cb8e9615 | [
"MIT"
] | 2 | 2020-02-07T15:59:15.000Z | 2020-08-05T21:55:27.000Z | src/py-ds-local/nightjar_ds_local/tests/main_test.py | groboclown/nightjar-mesh | 3655307b4a0ad00a0f18db835b3a0d04cb8e9615 | [
"MIT"
] | 1 | 2020-05-28T00:46:05.000Z | 2020-05-28T00:46:05.000Z |
"""Tests for the main module."""
import unittest
import os
from .util import Local
from .. import main
from ..config import ENV_NAME__LOCAL_FILE_TEMPLATES, ENV_NAME__LOCAL_FILE_DISCOVERY_MAP
class MainTest(unittest.TestCase):
"""Test the main function."""
def setUp(self) -> None:
self._local = Loca... | 31.836957 | 87 | 0.568795 |
import unittest
import os
from .util import Local
from .. import main
from ..config import ENV_NAME__LOCAL_FILE_TEMPLATES, ENV_NAME__LOCAL_FILE_DISCOVERY_MAP
class MainTest(unittest.TestCase):
def setUp(self) -> None:
self._local = Local()
os.environ[ENV_NAME__LOCAL_FILE_TEMPLATES] = self._loca... | true | true |
1c196bf01f74601b4b8b3a965bfa975f75977628 | 4,648 | py | Python | example/server/settings.py | ouattararomuald/django-polaris | c18dbf7c42c7745673d2e59b2f473848d990297b | [
"Apache-2.0"
] | null | null | null | example/server/settings.py | ouattararomuald/django-polaris | c18dbf7c42c7745673d2e59b2f473848d990297b | [
"Apache-2.0"
] | null | null | null | example/server/settings.py | ouattararomuald/django-polaris | c18dbf7c42c7745673d2e59b2f473848d990297b | [
"Apache-2.0"
] | null | null | null | """
Django settings for reference server.
"""
import os
import environ
from django.utils.translation import gettext_lazy as _
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Load environment variables from .env
env = envi... | 28 | 83 | 0.678356 | import os
import environ
from django.utils.translation import gettext_lazy as _
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
env = environ.Env()
env_file = os.path.join(BASE_DIR, ".env")
if os.path.exists(env_file):
environ.Env.read_env(env_file)
SECRET_KEY = env("DJANGO_SECRET_KEY")... | true | true |
1c196c6b9977944be19a8da476ac6acf56d84db9 | 7,962 | py | Python | commands/base_commands/rolling.py | Zironic/arxcode | 95464f7e7545385799de821650a0b9da6d51d1bc | [
"MIT"
] | 5 | 2019-03-16T08:26:53.000Z | 2019-11-27T15:42:16.000Z | commands/base_commands/rolling.py | Zironic/arxcode | 95464f7e7545385799de821650a0b9da6d51d1bc | [
"MIT"
] | 7 | 2018-09-29T05:08:15.000Z | 2021-06-10T21:35:32.000Z | commands/base_commands/rolling.py | Zironic/arxcode | 95464f7e7545385799de821650a0b9da6d51d1bc | [
"MIT"
] | 7 | 2018-09-19T21:11:29.000Z | 2019-11-19T12:46:14.000Z | """
Commands for dice checks.
"""
from commands.base import ArxCommand
from world import stats_and_skills
from world.roll import Roll
class CmdDiceString(ArxCommand):
"""
@dicestring
Usage:
@dicestring <your very own dicestring here>
Customizes a message you see whenever any character does a @... | 39.81 | 120 | 0.582643 | from commands.base import ArxCommand
from world import stats_and_skills
from world.roll import Roll
class CmdDiceString(ArxCommand):
key = "@dicestring"
locks = "cmd:all()"
def func(self):
caller = self.caller
args = self.args
dicest = caller.db.dice_string
if not dicest:
... | true | true |
1c196cf157db9b642f7d724c93ffc53f91be855e | 8,988 | py | Python | tempoapiclient/client.py | martynbristow/tempo-api-python-client | f0b3bca5b6139a37586b9fa119a467d75fd92559 | [
"Apache-2.0"
] | null | null | null | tempoapiclient/client.py | martynbristow/tempo-api-python-client | f0b3bca5b6139a37586b9fa119a467d75fd92559 | [
"Apache-2.0"
] | null | null | null | tempoapiclient/client.py | martynbristow/tempo-api-python-client | f0b3bca5b6139a37586b9fa119a467d75fd92559 | [
"Apache-2.0"
] | null | null | null | # 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, software
# distributed under the Li... | 27.913043 | 120 | 0.574989 |
from __future__ import unicode_literals
from datetime import date, datetime
from .rest_client import RestAPIClient
class Tempo(RestAPIClient):
def __init__(self, auth_token, base_url="https://api.tempo.io/core/3", limit=1000):
self._limit = limit
self._base_url = base_url
... | true | true |
1c196df48f1a3f82c1f382bbfc04f749bf33e8e1 | 4,955 | py | Python | instagram/settings.py | mukhtarabdirahman/instagram | fd6ad09766617d3cb7dc608e7ecee912fa24c8ca | [
"MIT"
] | null | null | null | instagram/settings.py | mukhtarabdirahman/instagram | fd6ad09766617d3cb7dc608e7ecee912fa24c8ca | [
"MIT"
] | 3 | 2020-06-06T00:37:15.000Z | 2021-06-10T22:34:07.000Z | instagram/settings.py | mukhtarabdirahman/instagram | fd6ad09766617d3cb7dc608e7ecee912fa24c8ca | [
"MIT"
] | 1 | 2020-10-20T16:29:47.000Z | 2020-10-20T16:29:47.000Z | """
Django settings for instagram project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os... | 26.078947 | 91 | 0.664178 |
import os
import django_heroku
import dj_database_url
from decouple import config,Csv
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
MODE=config("MODE", default="dev")
SECRET_KEY = config('SECRET_KEY')
DEBUG = config('DEBUG', default=False, cast=bool)
if config('MODE')=="dev":
DATABAS... | true | true |
1c196f72554fd2c39f18d45c828ae1a0df0f23c6 | 10,432 | py | Python | rds/script/trajectory_plot.py | epfl-lasa/rds | 574b3881dbaf4fdcd785dd96ba4c451928454b40 | [
"MIT"
] | 12 | 2020-08-18T09:01:50.000Z | 2022-03-17T19:53:30.000Z | rds/script/trajectory_plot.py | epfl-lasa/rds | 574b3881dbaf4fdcd785dd96ba4c451928454b40 | [
"MIT"
] | null | null | null | rds/script/trajectory_plot.py | epfl-lasa/rds | 574b3881dbaf4fdcd785dd96ba4c451928454b40 | [
"MIT"
] | 1 | 2021-08-25T13:12:55.000Z | 2021-08-25T13:12:55.000Z | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.colors import LinearSegmentedColormap
import capsule_distance
capsule = capsule_distance.Capsule(0.18, -0.5, 0.45)
capsule_larger = capsule_distance.Capsule(0.18, -0.5, 0.5)
def cmap_map(function, cmap):
""" Applies fun... | 42.754098 | 164 | 0.703508 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.colors import LinearSegmentedColormap
import capsule_distance
capsule = capsule_distance.Capsule(0.18, -0.5, 0.45)
capsule_larger = capsule_distance.Capsule(0.18, -0.5, 0.5)
def cmap_map(function, cmap):
cdict = cmap._s... | true | true |
1c196fd29c311aa9f440b7e7287944e06801230b | 163 | py | Python | __init__.py | DracoY-code/Geometron3D | 1dd0076721c1e3dcbc27e1379aee43fe88bbb666 | [
"MIT"
] | 1 | 2020-06-02T09:08:25.000Z | 2020-06-02T09:08:25.000Z | __init__.py | DracoY-code/Geometron3D | 1dd0076721c1e3dcbc27e1379aee43fe88bbb666 | [
"MIT"
] | null | null | null | __init__.py | DracoY-code/Geometron3D | 1dd0076721c1e3dcbc27e1379aee43fe88bbb666 | [
"MIT"
] | 1 | 2021-07-15T16:27:07.000Z | 2021-07-15T16:27:07.000Z | """
Author: DracoY
The __init__ file to make Python environment recognize this directory as a package.
"""
from lib import locate
from main import main
| 18.111111 | 84 | 0.730061 |
from lib import locate
from main import main
| true | true |
1c1970f7e24512f1b76d6ec825058b984f9309f5 | 5,386 | py | Python | artifacts/old_dataset_versions/minimal_commits_v02/ProjectQ/ProjectQ#5/after/_ibm_http_client.py | MattePalte/Bugs-Quantum-Computing-Platforms | 0c1c805fd5dfce465a8955ee3faf81037023a23e | [
"MIT"
] | 3 | 2021-11-08T11:46:42.000Z | 2021-12-27T10:13:38.000Z | artifacts/minimal_bugfixes/ProjectQ/ProjectQ#5/after/_ibm_http_client.py | MattePalte/Bugs-Quantum-Computing-Platforms | 0c1c805fd5dfce465a8955ee3faf81037023a23e | [
"MIT"
] | 2 | 2021-11-09T14:57:09.000Z | 2022-01-12T12:35:58.000Z | artifacts/old_dataset_versions/minimal_commits_v02/ProjectQ/ProjectQ#5/after/_ibm_http_client.py | MattePalte/Bugs-Quantum-Computing-Platforms | 0c1c805fd5dfce465a8955ee3faf81037023a23e | [
"MIT"
] | null | null | null | # 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, software
# distribu... | 32.059524 | 77 | 0.686409 |
import requests
import getpass
import logging
import sys
import time
from requests.compat import urljoin
_api_url = 'https://quantumexperience.ng.bluemix.net/api/'
_api_url_status = 'https://quantumexperience.ng.bluemix.net/api/'
class DeviceOfflineError(Exception):
pass
def send(json_qasm, name, de... | true | true |
1c197161dd34471b7674fb9088380f7a04d36966 | 34,116 | py | Python | grpcsupport/protobuf/game_data_pb2.py | bretttrana/rlbot_slow_turn | 729f43a60a395ff988df459129d3a9d204a2028a | [
"MIT"
] | null | null | null | grpcsupport/protobuf/game_data_pb2.py | bretttrana/rlbot_slow_turn | 729f43a60a395ff988df459129d3a9d204a2028a | [
"MIT"
] | null | null | null | grpcsupport/protobuf/game_data_pb2.py | bretttrana/rlbot_slow_turn | 729f43a60a395ff988df459129d3a9d204a2028a | [
"MIT"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: grpcsupport/protobuf/game_data.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf impo... | 41.9631 | 3,258 | 0.732501 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google... | true | true |
1c197183fde0f234a5141189bbc89c2318dd0b12 | 13,541 | py | Python | p2p/kademlia.py | teotoplak/trinity | 6c67b5debfb94f74d0162c70f92ae3d13918b174 | [
"MIT"
] | 3 | 2019-06-17T13:59:20.000Z | 2021-05-02T22:09:13.000Z | p2p/kademlia.py | teotoplak/trinity | 6c67b5debfb94f74d0162c70f92ae3d13918b174 | [
"MIT"
] | 2 | 2019-04-30T06:22:12.000Z | 2019-06-14T04:27:18.000Z | p2p/kademlia.py | teotoplak/trinity | 6c67b5debfb94f74d0162c70f92ae3d13918b174 | [
"MIT"
] | 2 | 2019-12-14T02:52:32.000Z | 2021-02-18T23:04:44.000Z | import bisect
from functools import total_ordering
import ipaddress
import logging
import operator
import random
import struct
import time
from typing import (
Any,
Dict,
Iterable,
Iterator,
List,
Sized,
Tuple,
Type,
TypeVar,
)
from urllib import parse as urlparse
from eth_utils imp... | 34.108312 | 117 | 0.633262 | import bisect
from functools import total_ordering
import ipaddress
import logging
import operator
import random
import struct
import time
from typing import (
Any,
Dict,
Iterable,
Iterator,
List,
Sized,
Tuple,
Type,
TypeVar,
)
from urllib import parse as urlparse
from eth_utils imp... | true | true |
1c19734237dae1f934d004420fe0d91709fee2c6 | 15,456 | py | Python | sql/views.py | rookie-peng/DBP | 7af067aed1c5f7c50fe43a244c26e505482ea1cc | [
"Apache-2.0"
] | null | null | null | sql/views.py | rookie-peng/DBP | 7af067aed1c5f7c50fe43a244c26e505482ea1cc | [
"Apache-2.0"
] | null | null | null | sql/views.py | rookie-peng/DBP | 7af067aed1c5f7c50fe43a244c26e505482ea1cc | [
"Apache-2.0"
] | null | null | null | # -*- coding: UTF-8 -*-
import os
import traceback
import simplejson as json
from django.conf import settings
from django.contrib.auth.decorators import permission_required
from django.contrib.auth.models import Group
from django.core.exceptions import PermissionDenied
from django.shortcuts import render, get_object_... | 36.027972 | 120 | 0.697658 |
import os
import traceback
import simplejson as json
from django.conf import settings
from django.contrib.auth.decorators import permission_required
from django.contrib.auth.models import Group
from django.core.exceptions import PermissionDenied
from django.shortcuts import render, get_object_or_404
from django.http... | true | true |
1c1973b6b7b847009946c05396aa9fe08ef8a29b | 1,360 | py | Python | setup.py | SamBoutin/majorana-rgf-grape | 3233627125519a3cc36b1d167c00d39b54abc48d | [
"BSD-2-Clause"
] | null | null | null | setup.py | SamBoutin/majorana-rgf-grape | 3233627125519a3cc36b1d167c00d39b54abc48d | [
"BSD-2-Clause"
] | null | null | null | setup.py | SamBoutin/majorana-rgf-grape | 3233627125519a3cc36b1d167c00d39b54abc48d | [
"BSD-2-Clause"
] | null | null | null | """
This file is part of the rgf_grape python package.
Copyright (C) 2017-2018 S. Boutin
For details of the rgf_grape algorithm and applications see:
S. Boutin, J. Camirand Lemyre, and I. Garate, Majorana bound state engineering
via efficient real-space parameter optimization, ArXiv 1804.03170 (2018).
"""
import nump... | 35.789474 | 79 | 0.597794 |
import numpy
from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension
optim_path = 'rgf_grape/optimization/'
optim_files = [optim_path + '_functionsDefinitions.pyx',
optim_path + 'fctDefs.cpp']
rgf_path = 'rgf_grape/rgf/'
rgf_files = [rgf_path+'_rgf... | true | true |
1c1973f852683d396ae1546bdfea9b604594d289 | 1,595 | py | Python | IPython/qt/manager.py | pyarnold/ipython | c4797f7f069d0a974ddfa1e4251c7550c809dba0 | [
"BSD-3-Clause-Clear"
] | 1 | 2020-12-18T01:07:55.000Z | 2020-12-18T01:07:55.000Z | IPython/qt/manager.py | pyarnold/ipython | c4797f7f069d0a974ddfa1e4251c7550c809dba0 | [
"BSD-3-Clause-Clear"
] | null | null | null | IPython/qt/manager.py | pyarnold/ipython | c4797f7f069d0a974ddfa1e4251c7550c809dba0 | [
"BSD-3-Clause-Clear"
] | null | null | null | """ Defines a KernelClient that provides signals and slots.
"""
from IPython.external.qt import QtCore
# Local imports
from IPython.utils.traitlets import Bool, DottedObjectName
from IPython.kernel import KernelManager
from IPython.kernel.restarter import KernelRestarter
from .kernel_mixins import QtKernelManagerMi... | 29 | 75 | 0.668966 |
from IPython.external.qt import QtCore
from IPython.utils.traitlets import Bool, DottedObjectName
from IPython.kernel import KernelManager
from IPython.kernel.restarter import KernelRestarter
from .kernel_mixins import QtKernelManagerMixin, QtKernelRestarterMixin
class QtKernelRestarter(KernelRestarter, QtKernel... | true | true |
1c197555d69eed79368bc04f71f2a617fee6c3f4 | 6,872 | py | Python | isi_sdk_8_2_2/isi_sdk_8_2_2/models/nfs_settings_export_settings_map_all.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_2_2/isi_sdk_8_2_2/models/nfs_settings_export_settings_map_all.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_2_2/isi_sdk_8_2_2/models/nfs_settings_export_settings_map_all.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 9
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_8_2_2.models.auth_ac... | 34.019802 | 152 | 0.642462 |
import pprint
import re
import six
from isi_sdk_8_2_2.models.auth_access_access_item_file_group import AuthAccessAccessItemFileGroup
from isi_sdk_8_2_2.models.nfs_settings_export_settings_map_all_secondary_groups import NfsSettingsExportSettingsMapAllSecondaryGroups
class NfsSettingsExportSettingsMapAll(o... | true | true |
1c19757717b32c659446ec6a1c2c963e59054980 | 7,648 | py | Python | vgg16.py | AlexWang1996/classfication_utilities | 9b8fb19c99a1ba8503b6117401f1dce7840ce4a5 | [
"BSD-2-Clause"
] | null | null | null | vgg16.py | AlexWang1996/classfication_utilities | 9b8fb19c99a1ba8503b6117401f1dce7840ce4a5 | [
"BSD-2-Clause"
] | null | null | null | vgg16.py | AlexWang1996/classfication_utilities | 9b8fb19c99a1ba8503b6117401f1dce7840ce4a5 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import tensorflow as tf
import numpy as np
def vgg16(images, classes):
# conv1_1
with tf.name_scope('conv1_1') as scope:
kernel = tf.Variable(tf.truncated_normal([3, 3, 3, 64], dtype=tf.float32,stddev=1e-1), name='weights')
conv = tf.nn.conv2d(images,... | 50.986667 | 113 | 0.627484 |
import tensorflow as tf
import numpy as np
def vgg16(images, classes):
with tf.name_scope('conv1_1') as scope:
kernel = tf.Variable(tf.truncated_normal([3, 3, 3, 64], dtype=tf.float32,stddev=1e-1), name='weights')
conv = tf.nn.conv2d(images, kernel, [1, 1, 1, 1], padding='SAME')
bi... | true | true |
1c1975994f0786f6b604d47836d0c9a54764db8f | 124,418 | py | Python | sandbox/individual_names.py | rhefner1/ghidonations | aa1b263ce30c952400a5eac8739b1ef52a2e4fed | [
"Apache-2.0"
] | null | null | null | sandbox/individual_names.py | rhefner1/ghidonations | aa1b263ce30c952400a5eac8739b1ef52a2e4fed | [
"Apache-2.0"
] | 2 | 2015-03-11T04:59:20.000Z | 2016-02-08T16:42:06.000Z | sandbox/individual_names.py | rhefner1/ghidonations | aa1b263ce30c952400a5eac8739b1ef52a2e4fed | [
"Apache-2.0"
] | null | null | null | names = [
{
"GivenName":"Joe",
"Surname":"Schmoe",
"EmailAddress":"test@example.com",
"TelephoneNumber":"402-427-6916",
"StreetAddress":"785 Oak Way",
"City":"Kennard",
"State":"NE",
"ZipCode":68034
},
{
"GivenName":"Ethel",
"Surname":"Wagner",
"EmailAddress":"EthelGWag... | 24.873651 | 56 | 0.595959 | names = [
{
"GivenName":"Joe",
"Surname":"Schmoe",
"EmailAddress":"test@example.com",
"TelephoneNumber":"402-427-6916",
"StreetAddress":"785 Oak Way",
"City":"Kennard",
"State":"NE",
"ZipCode":68034
},
{
"GivenName":"Ethel",
"Surname":"Wagner",
"EmailAddress":"EthelGWag... | true | true |
1c19761fc458d755e9192d01e3bf56415fb78716 | 261 | py | Python | tests/test_ci_breaker.py | Aegdesil/ci-benchmark | d44a973aff963c1dbceaaf5d566a0b84a71a1fa2 | [
"MIT"
] | 1 | 2020-05-04T07:38:37.000Z | 2020-05-04T07:38:37.000Z | tests/test_ci_breaker.py | Aegdesil/ci-benchmark | d44a973aff963c1dbceaaf5d566a0b84a71a1fa2 | [
"MIT"
] | 6 | 2020-05-02T12:46:16.000Z | 2020-05-17T20:26:43.000Z | tests/test_ci_breaker.py | Aegdesil/ci-benchmark | d44a973aff963c1dbceaaf5d566a0b84a71a1fa2 | [
"MIT"
] | null | null | null | import unittest
from ci_benchmark.ci_breaker import CIBreaker
class TestCIBreaker(unittest.TestCase):
def setUp(self):
self.ci_breaker = CIBreaker()
def test_break(self):
self.assertEqual("CIBreaker", self.ci_breaker.test_covered())
| 21.75 | 69 | 0.731801 | import unittest
from ci_benchmark.ci_breaker import CIBreaker
class TestCIBreaker(unittest.TestCase):
def setUp(self):
self.ci_breaker = CIBreaker()
def test_break(self):
self.assertEqual("CIBreaker", self.ci_breaker.test_covered())
| true | true |
1c1976c2218147a2d9ee318533b2f21e58a9abe5 | 591 | py | Python | boxes/migrations/0002_auto_20150416_1853.py | buketkonuk/pythondotorg | 4d8d9728eea7c7b2fef32eb6f24fda409cf24a06 | [
"Apache-2.0"
] | 2 | 2021-04-06T16:22:51.000Z | 2021-05-04T13:48:42.000Z | boxes/migrations/0002_auto_20150416_1853.py | buketkonuk/pythondotorg | 4d8d9728eea7c7b2fef32eb6f24fda409cf24a06 | [
"Apache-2.0"
] | 7 | 2020-06-06T01:40:35.000Z | 2021-12-13T20:35:43.000Z | boxes/migrations/0002_auto_20150416_1853.py | buketkonuk/pythondotorg | 4d8d9728eea7c7b2fef32eb6f24fda409cf24a06 | [
"Apache-2.0"
] | 1 | 2019-09-02T00:51:38.000Z | 2019-09-02T00:51:38.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('boxes', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='box',
name='content_mar... | 28.142857 | 207 | 0.602369 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('boxes', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='box',
name='content_markup_type',
... | true | true |
1c1976f66b618e7d13d246e776dc0367a429d162 | 1,642 | py | Python | tools/ctexplain/util.py | kjlubick/bazel | 6f0913e6e75477ec297430102a8213333a12967e | [
"Apache-2.0"
] | 1 | 2022-03-22T11:55:06.000Z | 2022-03-22T11:55:06.000Z | tools/ctexplain/util.py | kjlubick/bazel | 6f0913e6e75477ec297430102a8213333a12967e | [
"Apache-2.0"
] | null | null | null | tools/ctexplain/util.py | kjlubick/bazel | 6f0913e6e75477ec297430102a8213333a12967e | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 30.981132 | 74 | 0.688794 |
import time
class ProgressStep:
def __init__(self, msg, show_done=True):
self.msg = msg
self.show_done = show_done
def __enter__(self):
print(self.msg + "...", flush=True, end="")
self.start_time = time.perf_counter()
def __exit__(self, exc_type, exc_value, traceback):
if sel... | true | true |
1c19784712d901ee41d52a7823eb4a7aa810dd15 | 1,829 | py | Python | deeppavlov/core/trainers/torch_trainer.py | xbodx/DeepPavlov | 4b60bf162df4294b8b0db3b72786cdd699c674fa | [
"Apache-2.0"
] | 5,893 | 2018-02-01T18:13:20.000Z | 2022-03-31T19:22:21.000Z | deeppavlov/core/trainers/torch_trainer.py | xbodx/DeepPavlov | 4b60bf162df4294b8b0db3b72786cdd699c674fa | [
"Apache-2.0"
] | 749 | 2018-01-31T11:36:02.000Z | 2022-03-30T07:24:22.000Z | deeppavlov/core/trainers/torch_trainer.py | xbodx/DeepPavlov | 4b60bf162df4294b8b0db3b72786cdd699c674fa | [
"Apache-2.0"
] | 1,155 | 2018-02-01T10:52:15.000Z | 2022-03-29T02:12:15.000Z | # Copyright 2019 Neural Networks and Deep Learning lab, MIPT
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 42.534884 | 98 | 0.734828 |
from logging import getLogger
from typing import Tuple, Optional, Iterable, Collection, Any
from deeppavlov.core.trainers.utils import Metric
from deeppavlov.core.common.registry import register
from deeppavlov.core.data.data_learning_iterator import DataLearningIterator
from deeppavlov.core.trainers.nn_... | true | true |
1c19786cdc5a08bb168dacd02e20df8c43693e45 | 15,444 | py | Python | src/m2_more_sequences.py | xuz11rhit/16-SequencesAndMutation | 60a3f936ba2e5873724a52b4884566d062a8eefe | [
"MIT"
] | null | null | null | src/m2_more_sequences.py | xuz11rhit/16-SequencesAndMutation | 60a3f936ba2e5873724a52b4884566d062a8eefe | [
"MIT"
] | null | null | null | src/m2_more_sequences.py | xuz11rhit/16-SequencesAndMutation | 60a3f936ba2e5873724a52b4884566d062a8eefe | [
"MIT"
] | null | null | null | """
This module lets you practice various patterns
for ITERATING through SEQUENCES, including selections from:
-- Beginning to end
-- Other ranges (e.g., backwards and every-3rd-item)
-- The COUNT/SUM/etc pattern
-- The FIND pattern (via LINEAR SEARCH)
-- The MAX/MIN pattern
-- Looking two places in the seq... | 37.394673 | 77 | 0.540275 |
def main():
run_test_shortest_string()
run_test_index_of_largest_number()
run_test_number_of_stutters()
run_test_is_palindrome()
run_test_count_same()
def run_test_shortest_string():
print()
print('--------------------------------------------------')
print('Testing the shortes... | true | true |
1c1978713ed13acfc45edeec75f6eff4332890cf | 5,613 | py | Python | docs/conf.py | yash-sudo/Memoir | 37e0243fc233673a3a3896c7f9564a057c3059fb | [
"MIT"
] | null | null | null | docs/conf.py | yash-sudo/Memoir | 37e0243fc233673a3a3896c7f9564a057c3059fb | [
"MIT"
] | null | null | null | docs/conf.py | yash-sudo/Memoir | 37e0243fc233673a3a3896c7f9564a057c3059fb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Memoir documentation build configuration file, created by
# sphinx-quickstart on Wed Apr 15 14:59:06 2020.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# aut... | 30.177419 | 79 | 0.682523 |
import sphinx_rtd_theme
import stanford_theme
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinx_rtd_theme',
'sphinx.ext.napoleon']
templates_path = ['_templates']
sour... | true | true |
1c19789d958bf9420f9caaf31004589db59185f3 | 4,775 | py | Python | Network_Train/lib/datasets/DSADataset.py | zhoubenjia/RAAR3DNet | b5f6486a9f1cbf9fdd2de6a141ad81354f39ee51 | [
"Apache-2.0"
] | 11 | 2021-01-22T02:01:02.000Z | 2022-01-19T06:41:25.000Z | Network_Train/lib/datasets/DSADataset.py | zhoubenjia/RAAR3DNet | b5f6486a9f1cbf9fdd2de6a141ad81354f39ee51 | [
"Apache-2.0"
] | 1 | 2021-05-21T02:18:22.000Z | 2021-05-21T02:18:22.000Z | Network_Train/lib/datasets/DSADataset.py | zhoubenjia/RAAR3DNet | b5f6486a9f1cbf9fdd2de6a141ad81354f39ee51 | [
"Apache-2.0"
] | 3 | 2021-01-22T02:01:07.000Z | 2021-09-09T07:38:10.000Z | import torch
from .base import Datasets as dataset
from torchvision import transforms, set_image_backend
import random, os
from PIL import Image
import numpy as np
import accimage
set_image_backend('accimage')
from scipy.ndimage.filters import gaussian_filter
import json
import matplotlib.pyplot as plt
mycma... | 43.807339 | 124 | 0.561885 | import torch
from .base import Datasets as dataset
from torchvision import transforms, set_image_backend
import random, os
from PIL import Image
import numpy as np
import accimage
set_image_backend('accimage')
from scipy.ndimage.filters import gaussian_filter
import json
import matplotlib.pyplot as plt
mycma... | true | true |
1c1978c5c9a61f82dd07bed9ec5a87338426f932 | 4,398 | py | Python | learning/models/decoders/SelectionalPreferences.py | phycept/relation-autoencoder | 7a43d4f1ea3a4155181712394b08a82c31c54db3 | [
"Apache-2.0"
] | 71 | 2016-03-25T08:41:22.000Z | 2021-07-05T04:51:31.000Z | learning/models/decoders/SelectionalPreferences.py | phycept/relation-autoencoder | 7a43d4f1ea3a4155181712394b08a82c31c54db3 | [
"Apache-2.0"
] | 4 | 2017-06-17T17:05:14.000Z | 2021-11-18T07:16:34.000Z | learning/models/decoders/SelectionalPreferences.py | phycept/relation-autoencoder | 7a43d4f1ea3a4155181712394b08a82c31c54db3 | [
"Apache-2.0"
] | 27 | 2016-05-16T01:21:49.000Z | 2022-03-09T03:55:11.000Z | __author__ = 'enfry'
import math
import theano
from definitions import settings
import numpy as np
import theano.tensor as T
import cPickle as pickle
class SelectionalPreferences(object):
def __init__(self, rng, embedSize, relationNum, argVocSize, data, ex_emb):
self.k = embedSize
self.r = relat... | 35.756098 | 114 | 0.571169 | __author__ = 'enfry'
import math
import theano
from definitions import settings
import numpy as np
import theano.tensor as T
import cPickle as pickle
class SelectionalPreferences(object):
def __init__(self, rng, embedSize, relationNum, argVocSize, data, ex_emb):
self.k = embedSize
self.r = relat... | true | true |
1c19798b62cea93b7b1604d120dd46bd22788abc | 313 | py | Python | python/Algorithms/WarmUp/Min-Max Sum.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | 1 | 2020-10-06T01:20:07.000Z | 2020-10-06T01:20:07.000Z | python/Algorithms/WarmUp/Min-Max Sum.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | null | null | null | python/Algorithms/WarmUp/Min-Max Sum.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | null | null | null | def miniMaxSum(arr):
maxi = 0
mini = 0
arr.sort()
print(max(arr))
for i in range(len(arr)-1):
mini += arr[i]
for j in range(1,len(arr)):
maxi +=arr[j]
print(mini,maxi)
if __name__ == '__main__':
arr = list(map(int, input().rstrip().split()))
miniMaxSum(arr)
| 18.411765 | 50 | 0.539936 | def miniMaxSum(arr):
maxi = 0
mini = 0
arr.sort()
print(max(arr))
for i in range(len(arr)-1):
mini += arr[i]
for j in range(1,len(arr)):
maxi +=arr[j]
print(mini,maxi)
if __name__ == '__main__':
arr = list(map(int, input().rstrip().split()))
miniMaxSum(arr)
| true | true |
1c197d7c2a633747f0798f189397d0c40b7e2321 | 9,767 | py | Python | tests/test_simplex.py | kochanczyk/PyBNF | d691d1a043b11b454f1317158067b65a47c6714b | [
"BSD-3-Clause"
] | null | null | null | tests/test_simplex.py | kochanczyk/PyBNF | d691d1a043b11b454f1317158067b65a47c6714b | [
"BSD-3-Clause"
] | null | null | null | tests/test_simplex.py | kochanczyk/PyBNF | d691d1a043b11b454f1317158067b65a47c6714b | [
"BSD-3-Clause"
] | null | null | null | from .context import data, algorithms, pset, objective, config
import numpy as np
from copy import deepcopy
from shutil import rmtree
class TestSimplex:
@classmethod
def setup_class(cls):
cls.data1s = [
'# time v1_result v2_result v3_result\n',
' 1 2.1 3.1 6.1\n'... | 46.732057 | 120 | 0.587079 | from .context import data, algorithms, pset, objective, config
import numpy as np
from copy import deepcopy
from shutil import rmtree
class TestSimplex:
@classmethod
def setup_class(cls):
cls.data1s = [
'# time v1_result v2_result v3_result\n',
' 1 2.1 3.1 6.1\n'... | true | true |
1c197e486ab1b7d0f26ac1402cfd60adbb91b71b | 503 | py | Python | rgram/notifications/migrations/0003_auto_20180621_0627.py | trashking/rgram | ca5549cdc177097c13043e38f57f6bce9d21240f | [
"MIT"
] | null | null | null | rgram/notifications/migrations/0003_auto_20180621_0627.py | trashking/rgram | ca5549cdc177097c13043e38f57f6bce9d21240f | [
"MIT"
] | 15 | 2020-06-05T18:24:54.000Z | 2022-03-08T22:50:13.000Z | rgram/notifications/migrations/0003_auto_20180621_0627.py | trashking/rgram | ca5549cdc177097c13043e38f57f6bce9d21240f | [
"MIT"
] | null | null | null | # Generated by Django 2.0.6 on 2018-06-21 06:27
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('notifications', '0002_auto_20180621_0624'),
]
operations = [
migrations.AlterField(
model_name=... | 25.15 | 123 | 0.650099 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('notifications', '0002_auto_20180621_0624'),
]
operations = [
migrations.AlterField(
model_name='notification',
name='image',
... | true | true |
1c197e92a83fe5168c4c6ec2470e3985924b4db7 | 5,095 | py | Python | Frequency/main_mit.py | guoyii/ECG | ef96d5e3291fd6abd0d2c6a2f3d433d2d7336d2e | [
"MIT"
] | 5 | 2020-04-19T14:30:52.000Z | 2021-11-16T18:25:07.000Z | Frequency/main_mit.py | guoyii/Emotion-ECG | ef96d5e3291fd6abd0d2c6a2f3d433d2d7336d2e | [
"MIT"
] | null | null | null | Frequency/main_mit.py | guoyii/Emotion-ECG | ef96d5e3291fd6abd0d2c6a2f3d433d2d7336d2e | [
"MIT"
] | null | null | null | from sklearn.decomposition import PCA
from sklearn.externals import joblib
from sklearn.svm import LinearSVC
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from utils import read_dataPath
from utils import read_data
from utils import myfft
from utils import mydwt
... | 36.654676 | 158 | 0.611187 | from sklearn.decomposition import PCA
from sklearn.externals import joblib
from sklearn.svm import LinearSVC
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from utils import read_dataPath
from utils import read_data
from utils import myfft
from utils import mydwt
... | true | true |
1c197ef01f0de2f947d3b11c1ef08ad6cfd0f7cb | 5,108 | py | Python | tests/test_platypus_paraparser.py | tongjianjun/reportlab | c5544d7d05dc9f74c388f534d1a271c85abb751b | [
"BSD-3-Clause"
] | 4 | 2019-08-13T09:54:55.000Z | 2021-11-10T02:15:49.000Z | tests/test_platypus_paraparser.py | cnauroth/reportlab | 377d4ff58491dc6de48551e730c3d7f72db783e5 | [
"BSD-3-Clause"
] | 1 | 2019-09-17T11:16:51.000Z | 2019-09-19T11:13:53.000Z | tests/test_platypus_paraparser.py | cnauroth/reportlab | 377d4ff58491dc6de48551e730c3d7f72db783e5 | [
"BSD-3-Clause"
] | null | null | null | #!/bin/env python
#Copyright ReportLab Europe Ltd. 2000-2017
#see license.txt for license details
#history TBC
#$Header$
__version__='3.3.0'
__doc__="""Tests of intra-paragraph parsing behaviour in Platypus."""
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, equalStrings
setOutDir(__name_... | 37.014493 | 91 | 0.629992 |
__version__='3.3.0'
__doc__="""Tests of intra-paragraph parsing behaviour in Platypus."""
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, equalStrings
setOutDir(__name__)
from pprint import pprint as pp
import unittest
from reportlab.platypus import cleanBlockQuotedText
from reportla... | true | true |
1c1982b02fe727e51a2e4f11bda8698758223d0f | 468 | py | Python | server/utils/urls.py | johnugeorge/medperf | 5bc3f643064df14e9476bd4d4c1a4c0cce5337d5 | [
"Apache-2.0"
] | 1 | 2021-09-24T18:09:53.000Z | 2021-09-24T18:09:53.000Z | server/utils/urls.py | johnugeorge/medperf | 5bc3f643064df14e9476bd4d4c1a4c0cce5337d5 | [
"Apache-2.0"
] | 2 | 2021-09-27T16:14:04.000Z | 2021-11-03T14:24:54.000Z | server/utils/urls.py | johnugeorge/medperf | 5bc3f643064df14e9476bd4d4c1a4c0cce5337d5 | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path("", views.User.as_view()),
path("benchmarks/", views.BenchmarkList.as_view()),
path("datasets/", views.DatasetList.as_view()),
path("mlcubes/", views.MlCubeList.as_view()),
path("results/", views.ModelResultList.as_view()),
... | 33.428571 | 75 | 0.702991 | from django.urls import path
from . import views
urlpatterns = [
path("", views.User.as_view()),
path("benchmarks/", views.BenchmarkList.as_view()),
path("datasets/", views.DatasetList.as_view()),
path("mlcubes/", views.MlCubeList.as_view()),
path("results/", views.ModelResultList.as_view()),
... | true | true |
1c1982de1e6f039d299436a6b67f7d1344c23e6f | 12,683 | py | Python | Database Scan/parseitem.py | Heckfer/Tibialyzer | 8923f228f76617062a943e896846f37b15b1fbb4 | [
"Apache-2.0"
] | 223 | 2016-01-31T22:52:13.000Z | 2022-02-03T00:04:06.000Z | Database Scan/parseitem.py | Heckfer/Tibialyzer | 8923f228f76617062a943e896846f37b15b1fbb4 | [
"Apache-2.0"
] | 333 | 2016-02-04T09:29:59.000Z | 2022-02-14T12:25:56.000Z | Database Scan/parseitem.py | Heckfer/Tibialyzer | 8923f228f76617062a943e896846f37b15b1fbb4 | [
"Apache-2.0"
] | 102 | 2016-02-01T22:39:33.000Z | 2022-03-22T21:27:12.000Z |
# Copyright 2016 Mark Raasveldt
#
# 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 wr... | 48.408397 | 293 | 0.576283 |
import math
import re
import urllib.request
import sqlite3
import time
lookRegex = re.compile('(<div id="twbox-look">[^\n]*)')
htmlTagRegex = re.compile('<[^>]*>')
numberRegex = re.compile('([0-9]+[,.]?[0-9]*[,.]?[0-9]*[,.]?[0-9]*[,.]?[0-9]*)')
imageRegex = re.compile('<a href="([^"]*)"[ \t\n]*class... | true | true |
1c1983d60dfd7a58aa7a1edf1882960e69bf3198 | 5,466 | py | Python | modules/Summary.py | HappyFaceGoettingen/HappyFaceCore | 6989b3ff110abbdd49533c42b06ad128ddebf7b8 | [
"Apache-2.0"
] | null | null | null | modules/Summary.py | HappyFaceGoettingen/HappyFaceCore | 6989b3ff110abbdd49533c42b06ad128ddebf7b8 | [
"Apache-2.0"
] | null | null | null | modules/Summary.py | HappyFaceGoettingen/HappyFaceCore | 6989b3ff110abbdd49533c42b06ad128ddebf7b8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2012 Institut für Experimentelle Kernphysik - Karlsruher Institut für Technologie
#
# 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://... | 48.371681 | 212 | 0.577936 |
import hf, lxml, logging, datetime
from sqlalchemy import *
from lxml import etree
from string import strip
class Summary(hf.module.ModuleBase):
config_keys = {
'site_keys': ('Colon separated list of site names. The values are prefixes for the actual url and category configuration. For exam... | true | true |
1c1983eb49a572f2496b7a322e41f44aa3d79c60 | 7,646 | py | Python | pymatgen/io/abinit/tests/test_abiobjects.py | naik-aakash/pymatgen | 394e0d71bf1d1025fcf75498cbb16aa3f41ce78c | [
"MIT"
] | 1 | 2022-03-24T04:12:16.000Z | 2022-03-24T04:12:16.000Z | pymatgen/io/abinit/tests/test_abiobjects.py | naik-aakash/pymatgen | 394e0d71bf1d1025fcf75498cbb16aa3f41ce78c | [
"MIT"
] | null | null | null | pymatgen/io/abinit/tests/test_abiobjects.py | naik-aakash/pymatgen | 394e0d71bf1d1025fcf75498cbb16aa3f41ce78c | [
"MIT"
] | null | null | null | # Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import os
import numpy as np
from pymatgen.core.structure import Structure
from pymatgen.core.units import Ha_to_eV, bohr_to_ang
from pymatgen.io.abinit.abiobjects import (
Electrons,
ElectronsAlgorithm,
KSamplin... | 31.208163 | 102 | 0.608815 |
import os
import numpy as np
from pymatgen.core.structure import Structure
from pymatgen.core.units import Ha_to_eV, bohr_to_ang
from pymatgen.io.abinit.abiobjects import (
Electrons,
ElectronsAlgorithm,
KSampling,
PPModel,
RelaxationMethod,
Smearing,
SpinMode,
lattice_from_abivars,... | true | true |
1c198457ea821f40d02f3e0c072b49a5d1891287 | 6,395 | py | Python | tests/python/test_colours.py | shawnrice/alfred-bundler | 2576bbe7cf409f5509e68ad833b4d08740f392f3 | [
"MIT"
] | 9 | 2015-07-10T22:24:04.000Z | 2021-12-25T02:37:16.000Z | tests/python/test_colours.py | shawnrice/alfred-bundler | 2576bbe7cf409f5509e68ad833b4d08740f392f3 | [
"MIT"
] | 4 | 2018-03-19T08:47:05.000Z | 2018-03-19T08:47:59.000Z | tests/python/test_colours.py | shawnrice/alfred-bundler | 2576bbe7cf409f5509e68ad833b4d08740f392f3 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: fileencoding=utf-8
"""
test_colours.py
Created by deanishe@deanishe.net on 2014-08-10.
Copyright (c) 2014 deanishe@deanishe.net
MIT Licence. See http://opensource.org/licenses/MIT
"""
from __future__ import print_function, unicode_literals
import os
import imp
impo... | 29.200913 | 78 | 0.603127 |
from __future__ import print_function, unicode_literals
import os
import imp
import random
import logging
import shutil
import unittest
from common import *
if not os.path.exists(BUNDLER_PATH):
bundlet = imp.load_source(
os.path.splitext(BUNDLET)[0],
BUNDLET_PATH
).AlfredBundler()
log =... | true | true |
1c19847816561fe035416b32f0f6a1eb5d02d214 | 2,808 | py | Python | tests/python/norm.py | NNstorm/MinkowskiEngine | 443b37a58c379b2482b5d160d9e874b356b4bf2f | [
"MIT"
] | 851 | 2020-07-09T21:35:06.000Z | 2022-03-31T14:35:57.000Z | tests/python/norm.py | NNstorm/MinkowskiEngine | 443b37a58c379b2482b5d160d9e874b356b4bf2f | [
"MIT"
] | 301 | 2020-07-09T21:51:23.000Z | 2022-03-30T12:23:24.000Z | tests/python/norm.py | NNstorm/MinkowskiEngine | 443b37a58c379b2482b5d160d9e874b356b4bf2f | [
"MIT"
] | 151 | 2020-07-15T09:22:09.000Z | 2022-03-23T21:32:47.000Z | # Copyright (c) 2020 NVIDIA CORPORATION.
# Copyright (c) 2018-2020 Chris Choy (chrischoy@ai.stanford.edu).
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including wit... | 35.1 | 87 | 0.701923 |
# Networks", CVPR'19 (https://arxiv.org/abs/1904.08755) if you use any part
# of the code.
import torch
import unittest
from MinkowskiEngine import (
SparseTensor,
MinkowskiInstanceNorm,
MinkowskiInstanceNormFunction,
)
from utils.gradcheck import gradcheck
from tests.python.common i... | true | true |
1c198511ebc721346f9e73122d7a01f341827e67 | 6,430 | py | Python | boosup/boosup/performance/views/index.py | developertqw2017/migrationDjango | f7256ec2af51da1179d2f957e1aa896191b7b514 | [
"MIT"
] | null | null | null | boosup/boosup/performance/views/index.py | developertqw2017/migrationDjango | f7256ec2af51da1179d2f957e1aa896191b7b514 | [
"MIT"
] | 16 | 2020-02-11T23:19:19.000Z | 2022-03-11T23:33:40.000Z | boosup/boosup/performance/views/index.py | developertqw2017/migrationDjango | f7256ec2af51da1179d2f957e1aa896191b7b514 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf8
'''
Created on 2016/9/21
@author: cloudy
'''
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from datetime import datetime
import random
SERVER_DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S"
from ..mo... | 38.969697 | 141 | 0.613686 |
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from datetime import datetime
import random
SERVER_DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S"
from ..models import Stakeholder, Record,MonthRecord,Config,ResultCheck,MonthPerformance... | true | true |
1c19858042203b070d439d9bb812b73e2c48e1aa | 161 | py | Python | fluids/assets/terrain.py | kargarisaac/Urban_Driving_Simulator | a9cea0568562e233b7430e249b83fdd71c6d8341 | [
"MIT"
] | 1 | 2021-05-20T14:32:56.000Z | 2021-05-20T14:32:56.000Z | fluids/assets/terrain.py | kargarisaac/Urban_Driving_Simulator | a9cea0568562e233b7430e249b83fdd71c6d8341 | [
"MIT"
] | null | null | null | fluids/assets/terrain.py | kargarisaac/Urban_Driving_Simulator | a9cea0568562e233b7430e249b83fdd71c6d8341 | [
"MIT"
] | null | null | null | from fluids.assets.shape import Shape
class Terrain(Shape):
def __init__(self, **kwargs):
Shape.__init__(self, color=(0xFD, 0xF8, 0xEF), **kwargs)
| 23 | 64 | 0.68323 | from fluids.assets.shape import Shape
class Terrain(Shape):
def __init__(self, **kwargs):
Shape.__init__(self, color=(0xFD, 0xF8, 0xEF), **kwargs)
| true | true |
1c1985c91088ecab3ab448bd200417d6e9f95b66 | 661 | py | Python | order/manage.py | Virusuki/AWS_MSA_service_order | 5b95fe1c86d06434f46ff2cb6be7add9874120a3 | [
"Apache-2.0"
] | null | null | null | order/manage.py | Virusuki/AWS_MSA_service_order | 5b95fe1c86d06434f46ff2cb6be7add9874120a3 | [
"Apache-2.0"
] | null | null | null | order/manage.py | Virusuki/AWS_MSA_service_order | 5b95fe1c86d06434f46ff2cb6be7add9874120a3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'order.settings')
try:
from django.core.management import execute_from_command_line
except Import... | 28.73913 | 73 | 0.677761 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'order.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
1c1987032f4b0f14b3fc9fb9c61a65c606b4f67e | 4,208 | py | Python | app/cogs/premium/patreon.py | fossabot/Starboard-2 | 798e2d04995ae7d920e76708b9ea8fae6f4af319 | [
"MIT"
] | 16 | 2021-01-19T19:12:00.000Z | 2021-12-21T12:00:04.000Z | app/cogs/premium/patreon.py | Davi-the-Mudkip/Starboard-2 | 4de3c689ffef007e4f4a279251d107d890b69b15 | [
"MIT"
] | 15 | 2021-04-02T16:58:48.000Z | 2022-03-28T06:09:49.000Z | app/cogs/premium/patreon.py | Davi-the-Mudkip/Starboard-2 | 4de3c689ffef007e4f4a279251d107d890b69b15 | [
"MIT"
] | 13 | 2021-01-21T14:26:00.000Z | 2021-09-29T18:55:17.000Z | import typing
from patreon.jsonapi.parser import JSONAPIParser
from patreon.jsonapi.url_util import build_url
from patreon.schemas import campaign
from patreon.utils import user_agent_string
from patreon.version_compatibility.utc_timezone import utc_timezone
from six.moves.urllib.parse import parse_qs, urlencode, urlp... | 35.361345 | 79 | 0.630228 | import typing
from patreon.jsonapi.parser import JSONAPIParser
from patreon.jsonapi.url_util import build_url
from patreon.schemas import campaign
from patreon.utils import user_agent_string
from patreon.version_compatibility.utc_timezone import utc_timezone
from six.moves.urllib.parse import parse_qs, urlencode, urlp... | true | true |
1c1987b59daa4d5b270170dfe3ade46d96e3a65c | 1,505 | py | Python | xlsxwriter/test/comparison/test_unicode_shift_jis.py | dthadi3/XlsxWriter | f1801e82240aa9c746ce14948ef95990b83162cf | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2020-07-01T07:24:37.000Z | 2020-07-01T07:24:37.000Z | xlsxwriter/test/comparison/test_unicode_shift_jis.py | dthadi3/XlsxWriter | f1801e82240aa9c746ce14948ef95990b83162cf | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_unicode_shift_jis.py | dthadi3/XlsxWriter | f1801e82240aa9c746ce14948ef95990b83162cf | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2020, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
import codecs
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparison... | 27.363636 | 79 | 0.594684 | true | true | |
1c1987f8b2d8211b56ad0731a7dc24a5d3901e12 | 29,353 | py | Python | ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py | bebule/ambari | 304f47c55f2a79ffd85abc40574d6847093bd7df | [
"Apache-2.0"
] | 1 | 2021-07-03T08:17:34.000Z | 2021-07-03T08:17:34.000Z | ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py | bebule/ambari | 304f47c55f2a79ffd85abc40574d6847093bd7df | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py | bebule/ambari | 304f47c55f2a79ffd85abc40574d6847093bd7df | [
"Apache-2.0"
] | null | null | null | """
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 use this ... | 50.696028 | 175 | 0.800668 | """
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 use this ... | false | true |
1c1988e38620d21098292bf011e83fdc0a0bf324 | 2,067 | py | Python | src/tests/test_var_funcs.py | mnichol3/emip | fcd5c9fff7f6fdeee5aed3115b8ac63656c9d91d | [
"MIT"
] | null | null | null | src/tests/test_var_funcs.py | mnichol3/emip | fcd5c9fff7f6fdeee5aed3115b8ac63656c9d91d | [
"MIT"
] | null | null | null | src/tests/test_var_funcs.py | mnichol3/emip | fcd5c9fff7f6fdeee5aed3115b8ac63656c9d91d | [
"MIT"
] | 1 | 2021-12-15T15:57:44.000Z | 2021-12-15T15:57:44.000Z | """
Tests functions in var_funcs.py
Matt Nicholson
9 April 2020
"""
import netCDF4
import sys
import unittest
import numpy as np
# Insert src directory to Python path for importing
sys.path.insert(1, '..')
import netcdf
import var_funcs
class TestNetcdf(unittest.TestCase):
def setUp(self):
self.n... | 29.956522 | 93 | 0.630866 | import netCDF4
import sys
import unittest
import numpy as np
sys.path.insert(1, '..')
import netcdf
import var_funcs
class TestNetcdf(unittest.TestCase):
def setUp(self):
self.nc_fname = 'dryso4_AERmon_GISS-E2-1-G_piClim-SO2_r1i1p5f103_gn_200001-201412.nc'
self.netcdf_obj = netcdf.Netcdf(... | true | true |
1c1988ffd9f8f50accc55bd29746f952718f14c2 | 6,558 | py | Python | ros/src/tl_detector/light_classification/tl_classifier.py | sankalpdayal/ProgrammingCarla | 4cbb1ba2a9f861f544fa71f9d0db2beff5cdd3a0 | [
"MIT"
] | null | null | null | ros/src/tl_detector/light_classification/tl_classifier.py | sankalpdayal/ProgrammingCarla | 4cbb1ba2a9f861f544fa71f9d0db2beff5cdd3a0 | [
"MIT"
] | null | null | null | ros/src/tl_detector/light_classification/tl_classifier.py | sankalpdayal/ProgrammingCarla | 4cbb1ba2a9f861f544fa71f9d0db2beff5cdd3a0 | [
"MIT"
] | null | null | null | from styx_msgs.msg import TrafficLight
from sklearn.linear_model import LogisticRegression
import pickle
import tensorflow as tf
from keras.models import load_model
import numpy as np
import cv2
class TLClassifier(object):
def __init__(self):
#TODO load classifier
detect_model_name = 'ssd_mobilenet... | 42.038462 | 130 | 0.533089 | from styx_msgs.msg import TrafficLight
from sklearn.linear_model import LogisticRegression
import pickle
import tensorflow as tf
from keras.models import load_model
import numpy as np
import cv2
class TLClassifier(object):
def __init__(self):
detect_model_name = 'ssd_mobilenet_v1_coco_2018_01_28'
... | true | true |
1c1989441ff0d07fbdad4d9d028e1806ac2c39ce | 5,197 | py | Python | library_test.py | tdd-laboratory/tdd-homework-Toktar | 0fbfdbbec9e99dc16469bd3a0a79dbe31e5ea84e | [
"Apache-2.0"
] | null | null | null | library_test.py | tdd-laboratory/tdd-homework-Toktar | 0fbfdbbec9e99dc16469bd3a0a79dbe31e5ea84e | [
"Apache-2.0"
] | null | null | null | library_test.py | tdd-laboratory/tdd-homework-Toktar | 0fbfdbbec9e99dc16469bd3a0a79dbe31e5ea84e | [
"Apache-2.0"
] | null | null | null | import unittest
import library
NUM_CORPUS = '''
On the 5th of May every year, Mexicans celebrate Cinco de Mayo. This tradition
began in 1845 (the twenty-second anniversary of the Mexican Revolution), and
is the 1st example of a national independence holiday becoming popular in the
Western Hemisphere. (The Fourth of Ju... | 44.801724 | 99 | 0.686742 | import unittest
import library
NUM_CORPUS = '''
On the 5th of May every year, Mexicans celebrate Cinco de Mayo. This tradition
began in 1845 (the twenty-second anniversary of the Mexican Revolution), and
is the 1st example of a national independence holiday becoming popular in the
Western Hemisphere. (The Fourth of Ju... | true | true |
1c19899865cb12c43925025624bc4fa65389b676 | 1,590 | py | Python | pokemongo_bot/navigation/fort_navigator.py | pogosandbox/OpenPoGoBot | 4af8acc9a2c7c173bd8eaae723c5092f216c140f | [
"MIT"
] | 1 | 2017-08-16T11:37:27.000Z | 2017-08-16T11:37:27.000Z | pokemongo_bot/navigation/fort_navigator.py | pogosandbox/OpenPoGoBot | 4af8acc9a2c7c173bd8eaae723c5092f216c140f | [
"MIT"
] | null | null | null | pokemongo_bot/navigation/fort_navigator.py | pogosandbox/OpenPoGoBot | 4af8acc9a2c7c173bd8eaae723c5092f216c140f | [
"MIT"
] | null | null | null | from app import kernel
from pokemongo_bot.navigation.destination import Destination
from pokemongo_bot.navigation.navigator import Navigator
from pokemongo_bot.utils import distance
@kernel.container.register('fort_navigator', ['@config.core', '@stealth_api'])
class FortNavigator(Navigator):
def navigate(self, ma... | 40.769231 | 119 | 0.610692 | from app import kernel
from pokemongo_bot.navigation.destination import Destination
from pokemongo_bot.navigation.navigator import Navigator
from pokemongo_bot.utils import distance
@kernel.container.register('fort_navigator', ['@config.core', '@stealth_api'])
class FortNavigator(Navigator):
def navigate(self, ma... | true | true |
1c1989eb07537a4c5c1b3ad712c9caad3aa38fcb | 620 | py | Python | django/routers.py | PODTYAZHKI/front-web-project | 9d8fd7faf9809e348dda3a3a650fad61984ad923 | [
"MIT"
] | null | null | null | django/routers.py | PODTYAZHKI/front-web-project | 9d8fd7faf9809e348dda3a3a650fad61984ad923 | [
"MIT"
] | null | null | null | django/routers.py | PODTYAZHKI/front-web-project | 9d8fd7faf9809e348dda3a3a650fad61984ad923 | [
"MIT"
] | null | null | null | from rest_framework.routers import SimpleRouter
from users.views import UserViewSet
from auth.views import LoginViewSet, RegistrationViewSet, RefreshViewSet
from APIViewset import API
routes = SimpleRouter()
# AUTHENTICATION
routes.register(r'auth/login', LoginViewSet, basename='auth-login')
routes.register(r'auth/re... | 28.181818 | 80 | 0.791935 | from rest_framework.routers import SimpleRouter
from users.views import UserViewSet
from auth.views import LoginViewSet, RegistrationViewSet, RefreshViewSet
from APIViewset import API
routes = SimpleRouter()
routes.register(r'auth/login', LoginViewSet, basename='auth-login')
routes.register(r'auth/register', Registr... | true | true |
1c198a562012860b7cf972fdd4168046ad339eb0 | 17,250 | py | Python | festivallib/model.py | magne4000/festival | a8c26ba1565c3a2256afd4258480928728fc1100 | [
"MIT"
] | 14 | 2015-01-30T16:05:48.000Z | 2021-12-10T13:15:42.000Z | festivallib/model.py | magne4000/festival | a8c26ba1565c3a2256afd4258480928728fc1100 | [
"MIT"
] | 45 | 2015-01-29T09:39:27.000Z | 2018-04-15T18:58:32.000Z | festivallib/model.py | magne4000/festival | a8c26ba1565c3a2256afd4258480928728fc1100 | [
"MIT"
] | 6 | 2015-07-29T12:46:58.000Z | 2017-07-29T23:56:24.000Z | import mimetypes
import os
import re
from contextlib import contextmanager
from datetime import datetime
from flask import current_app
from sqlalchemy import Column, Integer, String, Float, DateTime, ForeignKey, distinct, event, UniqueConstraint, \
create_engine
from sqlalchemy import types
from sqlalchemy.ext.dec... | 34.5 | 119 | 0.618667 | import mimetypes
import os
import re
from contextlib import contextmanager
from datetime import datetime
from flask import current_app
from sqlalchemy import Column, Integer, String, Float, DateTime, ForeignKey, distinct, event, UniqueConstraint, \
create_engine
from sqlalchemy import types
from sqlalchemy.ext.dec... | true | true |
1c198afaff933f7352c3e6a800aca6a6837ff1cc | 506 | py | Python | python/mikeocr.py | pection-zz/Allproject | 25dd122cb4b30a360894aba0be4b4a62f465b68e | [
"MIT"
] | 2 | 2020-09-19T04:22:52.000Z | 2020-09-23T14:04:17.000Z | python/mikeocr.py | pection/Allproject | 25dd122cb4b30a360894aba0be4b4a62f465b68e | [
"MIT"
] | null | null | null | python/mikeocr.py | pection/Allproject | 25dd122cb4b30a360894aba0be4b4a62f465b68e | [
"MIT"
] | 2 | 2020-09-13T03:47:22.000Z | 2020-09-23T14:04:19.000Z | try:
from PIL import Image
except ImportError:
import Image
import pytesseract
def ocr_core(filename):
"""
This function will handle the core OCR processing of images.
"""
text = pytesseract.image_to_string(Image.open(filename),lang='tha') # We'll use Pillow's Image class to open the image and... | 33.733333 | 173 | 0.741107 | try:
from PIL import Image
except ImportError:
import Image
import pytesseract
def ocr_core(filename):
text = pytesseract.image_to_string(Image.open(filename),lang='tha')
return text
pytesseract.pytesseract.tesseract_cmd = '/usr/local/Cellar/tesseract/4.1.1/bin/tesseract'
print(ocr_core('location.p... | true | true |
1c198c157039258799e660fe675d4f1c9f09b632 | 4,081 | py | Python | msgraph/cli/command_modules/usersfunctions/azext_usersfunctions/vendored_sdks/usersfunctions/aio/operations/_usersmanagedappregistrations_operations.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | null | null | null | msgraph/cli/command_modules/usersfunctions/azext_usersfunctions/vendored_sdks/usersfunctions/aio/operations/_usersmanagedappregistrations_operations.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | 22 | 2022-03-29T22:54:37.000Z | 2022-03-29T22:55:27.000Z | msgraph/cli/command_modules/usersfunctions/azext_usersfunctions/vendored_sdks/usersfunctions/aio/operations/_usersmanagedappregistrations_operations.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | null | null | null | # 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.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 42.957895 | 180 | 0.67998 |
from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport impor... | true | true |
1c198cf83b3f171f9d862c0fd616188f24351cf7 | 7,094 | py | Python | LSH.py | Jin-Tao-208/web_science_coursework | bb4ab2226b70e7b0f7bbef40ceb002900e757a31 | [
"MIT"
] | null | null | null | LSH.py | Jin-Tao-208/web_science_coursework | bb4ab2226b70e7b0f7bbef40ceb002900e757a31 | [
"MIT"
] | null | null | null | LSH.py | Jin-Tao-208/web_science_coursework | bb4ab2226b70e7b0f7bbef40ceb002900e757a31 | [
"MIT"
] | null | null | null | from pymongo import MongoClient
from nltk.tokenize import RegexpTokenizer
from stop_words import get_stop_words
import sys
import random
import time
import binascii
import numpy as np
import re
import json
# client = MongoClient('127.0.0.1', 27017) # is assigned local port
# dbName = "TwitterDump" # set-... | 27.710938 | 121 | 0.583874 | from pymongo import MongoClient
from nltk.tokenize import RegexpTokenizer
from stop_words import get_stop_words
import sys
import random
import time
import binascii
import numpy as np
import re
import json
SHdata/LSHdata.json', 'r', encoding='utf-8') as f:
data1 = json.load(f)
for i in range(0, len(... | true | true |
1c198d281b15dc22888963fbd33c899ca0a46821 | 1,541 | py | Python | codes/models/recognizers/recognizer3d.py | dreamerlin/MVFNet | ed336228ad88821ffe407a4355017acb416e4670 | [
"Apache-2.0"
] | 102 | 2020-12-16T03:55:21.000Z | 2022-03-11T03:46:03.000Z | codes/models/recognizers/recognizer3d.py | ImportPaddle/MVFNet-Paddle | 5bc41ae0451a2c3572302c441aaf35b444d04d56 | [
"Apache-2.0"
] | 4 | 2021-06-14T18:43:53.000Z | 2022-03-28T16:28:51.000Z | codes/models/recognizers/recognizer3d.py | ImportPaddle/MVFNet-Paddle | 5bc41ae0451a2c3572302c441aaf35b444d04d56 | [
"Apache-2.0"
] | 8 | 2021-03-03T00:18:58.000Z | 2022-02-18T07:20:06.000Z | """recognizer3d"""
from ..builder import RECOGNIZERS
from .base import BaseRecognizer
@RECOGNIZERS.register_module
class Recognizer3D(BaseRecognizer):
"""class for recognizer3d"""
def __init__(self,
backbone,
cls_head,
fcn_testing=False,
trai... | 29.075472 | 62 | 0.560026 | from ..builder import RECOGNIZERS
from .base import BaseRecognizer
@RECOGNIZERS.register_module
class Recognizer3D(BaseRecognizer):
def __init__(self,
backbone,
cls_head,
fcn_testing=False,
train_cfg=None,
test_cfg=None):
... | true | true |
1c198dd1622cfb1041b0bb5026cb618d835895d3 | 997 | py | Python | trees_and_graphs/3-graph_bfs.py | kemar/data_structures | eaa886cc2f9eccd8a83ed3ab313dc70c57fbac0b | [
"Unlicense"
] | null | null | null | trees_and_graphs/3-graph_bfs.py | kemar/data_structures | eaa886cc2f9eccd8a83ed3ab313dc70c57fbac0b | [
"Unlicense"
] | null | null | null | trees_and_graphs/3-graph_bfs.py | kemar/data_structures | eaa886cc2f9eccd8a83ed3ab313dc70c57fbac0b | [
"Unlicense"
] | 4 | 2020-03-27T16:23:47.000Z | 2022-03-21T09:20:56.000Z | from collections import deque
graph = {
'A': ['B', 'C'],
'B': ['C', 'D'],
'C': ['D'],
'D': ['C'],
'E': ['F'],
'F': ['C'],
}
def iterative_bfs(graph, start):
visited = []
queue = deque()
queue.append(start)
while queue:
node = queue.popleft()
if node not in vi... | 23.186047 | 69 | 0.543631 | from collections import deque
graph = {
'A': ['B', 'C'],
'B': ['C', 'D'],
'C': ['D'],
'D': ['C'],
'E': ['F'],
'F': ['C'],
}
def iterative_bfs(graph, start):
visited = []
queue = deque()
queue.append(start)
while queue:
node = queue.popleft()
if node not in vi... | true | true |
1c198f37737732dcafbb510e91197a158a0063a9 | 5,353 | py | Python | contrib/python/visioncpp/codegen.py | GeorgeWeb/visioncpp | b2131d86e211c8b953d3f9c24328bdc2cb2458e8 | [
"Apache-2.0"
] | null | null | null | contrib/python/visioncpp/codegen.py | GeorgeWeb/visioncpp | b2131d86e211c8b953d3f9c24328bdc2cb2458e8 | [
"Apache-2.0"
] | null | null | null | contrib/python/visioncpp/codegen.py | GeorgeWeb/visioncpp | b2131d86e211c8b953d3f9c24328bdc2cb2458e8 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import visioncpp as vp
import logging
import sys
from collections import defaultdict
from distutils.spawn import find_executable
from labm8 import types
from subprocess import Popen, PIPE
from visioncpp import util
def library_source(lines, pipeline):
"""
Return sourc... | 26.112195 | 78 | 0.622081 | from __future__ import print_function
import visioncpp as vp
import logging
import sys
from collections import defaultdict
from distutils.spawn import find_executable
from labm8 import types
from subprocess import Popen, PIPE
from visioncpp import util
def library_source(lines, pipeline):
def get_input_nodes(... | true | true |
1c19905c43ffd32faac78173baf9d4a7c0d79cc5 | 3,146 | py | Python | Works/L4_BabyNames/milestone1.py | jackchienchen/StanCode-SC101 | 7a5b9256b128e58482ca37d8f5ab76483be971be | [
"MIT"
] | 2 | 2022-01-26T10:18:23.000Z | 2022-01-26T10:18:24.000Z | Works/L4_BabyNames/milestone1.py | jackchienchen/StanCode-SC101 | 7a5b9256b128e58482ca37d8f5ab76483be971be | [
"MIT"
] | null | null | null | Works/L4_BabyNames/milestone1.py | jackchienchen/StanCode-SC101 | 7a5b9256b128e58482ca37d8f5ab76483be971be | [
"MIT"
] | null | null | null | """
File: milestone1.py
Name: Jack Chen
-----------------------
This file tests the milestone 1 for
our babyname.py project
"""
import sys
def add_data_for_name(name_data, year, rank, name):
"""
Adds the given year and rank to the associated name in the name_data dict.
Input:
name_data (dict): d... | 32.43299 | 107 | 0.511443 |
import sys
def add_data_for_name(name_data, year, rank, name):
if name in name_data:
year_d = name_data[name]
if year in year_d:
if int(rank) < int(year_d[year]):
year_d[year] = rank
else:
pass
else:
year_d[year] = ra... | true | true |
1c1990b20d3b7cc6ddfdb1498aa7c0fd35f29082 | 48 | py | Python | moya/elements/__init__.py | moyaproject/moya | 78b91d87b4519f91dfdd2b40dab44e72f201a843 | [
"MIT"
] | 129 | 2015-02-16T12:02:50.000Z | 2021-11-06T00:20:01.000Z | moya/elements/__init__.py | liaohandel/moya | 78b91d87b4519f91dfdd2b40dab44e72f201a843 | [
"MIT"
] | 5 | 2015-02-19T15:56:41.000Z | 2015-09-08T18:58:35.000Z | moya/elements/__init__.py | liaohandel/moya | 78b91d87b4519f91dfdd2b40dab44e72f201a843 | [
"MIT"
] | 14 | 2015-02-19T17:20:34.000Z | 2022-03-28T01:38:09.000Z | from .elementbase import ElementBase, Attribute
| 24 | 47 | 0.854167 | from .elementbase import ElementBase, Attribute
| true | true |
1c1990c93f0da58cabad94f1053f388726cc5bc2 | 12,900 | py | Python | crestdsl/model/api/convenienceAPI.py | stklik/CREST | 7fd97c50b0c6c923e1c477105bed4f0ea032bb99 | [
"MIT"
] | 14 | 2019-08-06T10:17:46.000Z | 2022-03-13T12:50:59.000Z | crestdsl/model/api/convenienceAPI.py | stklik/CREST | 7fd97c50b0c6c923e1c477105bed4f0ea032bb99 | [
"MIT"
] | 16 | 2018-01-20T00:54:24.000Z | 2019-07-24T15:43:42.000Z | crestdsl/model/api/convenienceAPI.py | stklik/CREST | 7fd97c50b0c6c923e1c477105bed4f0ea032bb99 | [
"MIT"
] | 1 | 2021-02-01T15:33:24.000Z | 2021-02-01T15:33:24.000Z | from . import get_name, get_parent
import crestdsl.model as crest
import crestdsl.model.meta as meta
import operator
def _replacability_checks(entity, name, obj, existing):
# TODO: clean me up ? These are lots of checks, maybe we need to make them look nice
if isinstance(obj, crest.Entity):
for updat... | 49.615385 | 162 | 0.681938 | from . import get_name, get_parent
import crestdsl.model as crest
import crestdsl.model.meta as meta
import operator
def _replacability_checks(entity, name, obj, existing):
if isinstance(obj, crest.Entity):
for update in crest.get_updates(entity):
if update.target in crest.get_inputs(ex... | true | true |
1c1991a56ddff99780720ee89a10ee184261f17b | 4,052 | py | Python | nextcord/ext/ipc/client.py | nextcord-ext/ipc | bd30f56cf572fe2603b59b6ce53d47d1d1629713 | [
"Apache-2.0"
] | 14 | 2021-09-02T06:04:06.000Z | 2022-03-16T14:22:30.000Z | nextcord/ext/ipc/client.py | nextcord-ext/ipc | bd30f56cf572fe2603b59b6ce53d47d1d1629713 | [
"Apache-2.0"
] | 5 | 2021-09-03T18:00:12.000Z | 2021-11-02T09:30:17.000Z | nextcord/ext/ipc/client.py | nextcord-ext/ipc | bd30f56cf572fe2603b59b6ce53d47d1d1629713 | [
"Apache-2.0"
] | 8 | 2021-09-09T17:59:44.000Z | 2021-11-25T13:39:12.000Z | import asyncio
import logging
import aiohttp
from .errors import *
log = logging.getLogger(__name__)
class Client:
"""
Handles webserver side requests to the bot process.
Parameters
----------
host: str
The IP or host of the IPC server, defaults to localhost
port: int
The po... | 29.794118 | 124 | 0.592794 | import asyncio
import logging
import aiohttp
from .errors import *
log = logging.getLogger(__name__)
class Client:
def __init__(self, host="localhost", port=None, multicast_port=20000, secret_key=None):
self.loop = asyncio.get_event_loop()
self.secret_key = secret_key
self.host = host... | true | true |
1c1991d50600104414240a735ab351583c809231 | 341 | py | Python | dynamic programming/Ratndeep/lcs.py | ayroti-18/Competitive-Programming | d1ea08a91c63e54f0bba2365e56f98db71eb9054 | [
"MIT"
] | 3 | 2020-12-20T10:23:11.000Z | 2021-06-16T10:34:18.000Z | dynamic programming/Ratndeep/lcs.py | Spring-dot/Competitive-Programming | 98add277a8b029710c749d1082de25c524e12408 | [
"MIT"
] | null | null | null | dynamic programming/Ratndeep/lcs.py | Spring-dot/Competitive-Programming | 98add277a8b029710c749d1082de25c524e12408 | [
"MIT"
] | null | null | null | str1 = input()
str2 = input()
matrix = [[0 for i in range(len(str1)+1)]for i in range(len(str2)+1)]
for i in range(len(str2)):
for j in range(len(str1)):
if str1[j]==str2[i]:
matrix[i+1][j+1]=1+matrix[i][j]
else:
matrix[i+1][j+1]=max(matrix[i+1][j],matrix[i][j+1])
print(ma... | 24.357143 | 69 | 0.539589 | str1 = input()
str2 = input()
matrix = [[0 for i in range(len(str1)+1)]for i in range(len(str2)+1)]
for i in range(len(str2)):
for j in range(len(str1)):
if str1[j]==str2[i]:
matrix[i+1][j+1]=1+matrix[i][j]
else:
matrix[i+1][j+1]=max(matrix[i+1][j],matrix[i][j+1])
print(ma... | true | true |
1c19934a0cac005d5defd0e49e2b8eecd5de643d | 18,681 | py | Python | itty.py | dwelch91/itty | a5a75dabe11b7bd61ad608db12539535c81cf6a2 | [
"BSD-3-Clause"
] | null | null | null | itty.py | dwelch91/itty | a5a75dabe11b7bd61ad608db12539535c81cf6a2 | [
"BSD-3-Clause"
] | null | null | null | itty.py | dwelch91/itty | a5a75dabe11b7bd61ad608db12539535c81cf6a2 | [
"BSD-3-Clause"
] | null | null | null | """
The itty-bitty Python web framework.
"""
import cgi
import mimetypes
import os
import re
from io import BytesIO
import sys
import traceback
from typing import Dict, Union, Callable, List, Tuple, Optional
from urllib.parse import parse_qs
from wsgiref.simple_server import make_server
__orig_author__ = 'Daniel Linds... | 29.558544 | 129 | 0.616295 | import cgi
import mimetypes
import os
import re
from io import BytesIO
import sys
import traceback
from typing import Dict, Union, Callable, List, Tuple, Optional
from urllib.parse import parse_qs
from wsgiref.simple_server import make_server
__orig_author__ = 'Daniel Lindsley'
__author__ = 'Don Welch'
__version__ = (... | true | true |
1c199374d109b4a2c69664142defd37ac8c8e63c | 12,028 | py | Python | scripts/haystack_files/haystack_upload_files.py | HighDeFing/thesis_v4 | 2dc9288af75a8b51fe54ed66f520e8aa8a0ab3c7 | [
"Apache-2.0"
] | null | null | null | scripts/haystack_files/haystack_upload_files.py | HighDeFing/thesis_v4 | 2dc9288af75a8b51fe54ed66f520e8aa8a0ab3c7 | [
"Apache-2.0"
] | null | null | null | scripts/haystack_files/haystack_upload_files.py | HighDeFing/thesis_v4 | 2dc9288af75a8b51fe54ed66f520e8aa8a0ab3c7 | [
"Apache-2.0"
] | null | null | null | from haystack.nodes import PDFToTextConverter
from haystack.document_stores import ElasticsearchDocumentStore
from haystack.nodes import DensePassageRetriever
from haystack.nodes import FARMReader, ElasticsearchRetriever
from haystack.pipelines import ExtractiveQAPipeline, DocumentSearchPipeline
from haystack.nodes imp... | 44.220588 | 2,262 | 0.67875 | from haystack.nodes import PDFToTextConverter
from haystack.document_stores import ElasticsearchDocumentStore
from haystack.nodes import DensePassageRetriever
from haystack.nodes import FARMReader, ElasticsearchRetriever
from haystack.pipelines import ExtractiveQAPipeline, DocumentSearchPipeline
from haystack.nodes imp... | true | true |
1c1993d2decedf3dab27f6777a0f9ef4985ffe5d | 778 | py | Python | installed_packages_diff/fetcher.py | cbuschka/pkgdiff | ae6aa96c789e432c33a2938a0a78f0800f99b188 | [
"MIT"
] | null | null | null | installed_packages_diff/fetcher.py | cbuschka/pkgdiff | ae6aa96c789e432c33a2938a0a78f0800f99b188 | [
"MIT"
] | 1 | 2021-08-23T17:48:10.000Z | 2021-08-23T20:11:08.000Z | installed_packages_diff/fetcher.py | cbuschka/pkgdiff | ae6aa96c789e432c33a2938a0a78f0800f99b188 | [
"MIT"
] | null | null | null | import logging
from .package import Package
from .transport_factory import TransportFactory
class PackageFetcher(object):
LIST_PACKAGES_COMMAND = {
"rpm": ["rpm", "-qa", "--queryformat", "%{NAME}-%{VERSION}\\t%{RELEASE}:%{ARCH}\\n"],
"dpkg": ["dpkg-query", "--show", "--showformat", "${source:Package}\\t${V... | 35.363636 | 107 | 0.696658 | import logging
from .package import Package
from .transport_factory import TransportFactory
class PackageFetcher(object):
LIST_PACKAGES_COMMAND = {
"rpm": ["rpm", "-qa", "--queryformat", "%{NAME}-%{VERSION}\\t%{RELEASE}:%{ARCH}\\n"],
"dpkg": ["dpkg-query", "--show", "--showformat", "${source:Package}\\t${V... | true | true |
1c199475662e9404da455ffc7caa2ee452348a25 | 1,442 | py | Python | clusto_query/clusto_backport.py | fakeNetflix/uber-repo-clusto-query | 4d8ee71a79924dfaa6b59d9693042bee15dc56ed | [
"0BSD"
] | null | null | null | clusto_query/clusto_backport.py | fakeNetflix/uber-repo-clusto-query | 4d8ee71a79924dfaa6b59d9693042bee15dc56ed | [
"0BSD"
] | null | null | null | clusto_query/clusto_backport.py | fakeNetflix/uber-repo-clusto-query | 4d8ee71a79924dfaa6b59d9693042bee15dc56ed | [
"0BSD"
] | null | null | null | import collections
from clusto import ENTITY_TABLE, ATTR_TABLE, SESSION
from sqlalchemy import select, and_
# ## BACKPORT FROM CLUSTO 0.7.8 ## #
# TODO: delete me after 0.7.8 is widely-deployed
Adjacency = collections.namedtuple(
'Adjacency',
['parent_id', 'parent_name', 'parent_type', 'child_id', 'child_na... | 28.84 | 93 | 0.652566 | import collections
from clusto import ENTITY_TABLE, ATTR_TABLE, SESSION
from sqlalchemy import select, and_
parent_name', 'parent_type', 'child_id', 'child_name', 'child_type']
)
def adjacency_map():
parent_entities = ENTITY_TABLE.alias()
child_entities = ENTITY_TABLE.alias()
entity_attrs = ATTR_TABLE
... | true | true |
1c19948ad4f682f5328c5be0a3592b9c9e162c0e | 16,499 | py | Python | simulations_toys_sc1_grad_grid.py | harmonic-minimization/harmoni_manuscript_codes | 6cecd98208b3955d0a20b1d258cc06477e615edf | [
"MIT"
] | 1 | 2021-12-16T08:00:15.000Z | 2021-12-16T08:00:15.000Z | simulations_toys_sc1_grad_grid.py | harmonic-minimization/harmoni_manuscript_codes | 6cecd98208b3955d0a20b1d258cc06477e615edf | [
"MIT"
] | null | null | null | simulations_toys_sc1_grad_grid.py | harmonic-minimization/harmoni_manuscript_codes | 6cecd98208b3955d0a20b1d258cc06477e615edf | [
"MIT"
] | null | null | null | """
-----------------------------------------------------------------------
Harmoni: a Novel Method for Eliminating Spurious Neuronal Interactions due to the Harmonic Components in Neuronal Data
Mina Jamshidi Idaji, Juanli Zhang, Tilman Stephani, Guido Nolte, Klaus-Robert Mueller, Arno Villringer, Vadim V. Nikulin
http... | 39.283333 | 206 | 0.624098 |
import numpy as np
from numpy import pi
import os.path as op
from matplotlib import pyplot as plt
from scipy.signal import filtfilt, butter
from tools_signal import *
from tools_simulations import data_fun_pink_noise, filtered_randn, produce_nm_phase_locked_sig, adjust_snr
from tools_general import *
from tools_conn... | true | true |
1c1994e1c6dffee076c1c49aad081c07142e0827 | 455 | py | Python | django_summernote_ajax/settings.py | pincoin/django-summernote-ajax | edfc63975340b259a39feb9b060474d0903a39e3 | [
"MIT"
] | 2 | 2018-01-17T04:30:01.000Z | 2020-10-17T21:26:50.000Z | django_summernote_ajax/settings.py | pincoin/django-summernote-ajax | edfc63975340b259a39feb9b060474d0903a39e3 | [
"MIT"
] | 12 | 2018-01-29T15:59:05.000Z | 2022-03-11T23:18:30.000Z | django_summernote_ajax/settings.py | pincoin/django-summernote-ajax | edfc63975340b259a39feb9b060474d0903a39e3 | [
"MIT"
] | 1 | 2018-01-17T03:12:24.000Z | 2018-01-17T03:12:24.000Z | from django.conf import settings
# The content-type header uploaded with the file (e.g. text/plain or application/pdf)
DSA_CONTENT_TYPES = getattr(settings, 'DSA_CONTENT_TYPES', ['image', 'video'])
# The allowed file extensions
DSA_FILE_EXTENSIONS = getattr(settings, 'DSA_FILE_EXTENSIONS', ['jpg', 'jpeg', 'gif', 'png... | 41.363636 | 93 | 0.756044 | from django.conf import settings
DSA_CONTENT_TYPES = getattr(settings, 'DSA_CONTENT_TYPES', ['image', 'video'])
DSA_FILE_EXTENSIONS = getattr(settings, 'DSA_FILE_EXTENSIONS', ['jpg', 'jpeg', 'gif', 'png'])
DSA_MAX_UPLOAD_SIZE = getattr(settings, 'DSA_MAX_UPLOAD_SIZE', 2097152)
| true | true |
1c199525d4d0b996c874d5454e2edc2a90916b4c | 51,550 | py | Python | homeassistant/helpers/script.py | ZMan88/core | cc6228f5c943347f3e11b0859f26ba298d23d479 | [
"Apache-2.0"
] | 2 | 2018-01-14T07:08:52.000Z | 2018-06-01T17:43:35.000Z | homeassistant/helpers/script.py | ZMan88/core | cc6228f5c943347f3e11b0859f26ba298d23d479 | [
"Apache-2.0"
] | 83 | 2020-07-31T21:32:45.000Z | 2022-03-31T10:00:54.000Z | homeassistant/helpers/script.py | ZMan88/core | cc6228f5c943347f3e11b0859f26ba298d23d479 | [
"Apache-2.0"
] | 4 | 2020-10-29T22:56:04.000Z | 2020-12-12T21:51:40.000Z | """Helpers to execute scripts."""
from __future__ import annotations
import asyncio
from collections.abc import Callable, Sequence
from contextlib import asynccontextmanager, suppress
from datetime import datetime, timedelta
from functools import partial
import itertools
import logging
from types import MappingProxyTy... | 35.478321 | 94 | 0.610339 | from __future__ import annotations
import asyncio
from collections.abc import Callable, Sequence
from contextlib import asynccontextmanager, suppress
from datetime import datetime, timedelta
from functools import partial
import itertools
import logging
from types import MappingProxyType
from typing import Any, Dict, T... | true | true |
1c1996f40f74e01d9fffef29e71cda349464f7f1 | 3,202 | py | Python | Tools/peg_generator/scripts/show_parse.py | chexca/cpython | cfc6ce4d40f2f01314b7e283fb972a7bb3ed3faa | [
"CNRI-Python-GPL-Compatible"
] | 1 | 2020-06-01T06:50:07.000Z | 2020-06-01T06:50:07.000Z | Tools/peg_generator/scripts/show_parse.py | chexca/cpython | cfc6ce4d40f2f01314b7e283fb972a7bb3ed3faa | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Tools/peg_generator/scripts/show_parse.py | chexca/cpython | cfc6ce4d40f2f01314b7e283fb972a7bb3ed3faa | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | #!/usr/bin/env python3.8
"""Show the parse tree for a given program, nicely formatted.
Example:
$ scripts/show_parse.py a+b
Module(
body=[
Expr(
value=BinOp(
left=Name(id="a", ctx=Load()), op=Add(), right=Name(id="b", ctx=Load())
)
)
],
type_ignores... | 27.367521 | 96 | 0.621487 |
import argparse
import ast
import difflib
import os
import sys
import tempfile
import _peg_parser
from typing import List
sys.path.insert(0, os.getcwd())
from pegen.ast_dump import ast_dump
parser = argparse.ArgumentParser()
parser.add_argument(
"-d", "--diff", action="store_true", help="show diff between gr... | true | true |
1c19972cbf1601062a32252cdcfc38cbb808159f | 3,765 | py | Python | siunn1ua2ah4/settings.py | i3thuan5/siunn1ua2ah4 | a81241245c6ab4012543487734e79f88ca3813f9 | [
"MIT"
] | null | null | null | siunn1ua2ah4/settings.py | i3thuan5/siunn1ua2ah4 | a81241245c6ab4012543487734e79f88ca3813f9 | [
"MIT"
] | 23 | 2017-05-10T09:56:53.000Z | 2019-01-25T09:38:52.000Z | siunn1ua2ah4/settings.py | i3thuan5/Siunn1ua2ah4 | a81241245c6ab4012543487734e79f88ca3813f9 | [
"MIT"
] | 1 | 2017-06-07T08:17:22.000Z | 2017-06-07T08:17:22.000Z | """
Django settings for siunn1ua2ah4 project.
Generated by 'django-admin startproject' using Django 1.11.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
impo... | 25.439189 | 91 | 0.681541 |
import os
from 臺灣言語工具.音標系統.閩南語.臺灣閩南語羅馬字拼音 import 臺灣閩南語羅馬字拼音
from 臺灣言語工具.音標系統.客話.臺灣客家話拼音 import 臺灣客家話拼音
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DEBUG = True
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth'... | true | true |
1c19980aab067a3425ca0933e39e01c49b6ff7a0 | 10,773 | py | Python | src/regularization_utils.py | uditgupta002/RegularizationMethodsForNN | 2554e088bafa9932e6e4d7f5ba033a2b79afe29d | [
"MIT"
] | null | null | null | src/regularization_utils.py | uditgupta002/RegularizationMethodsForNN | 2554e088bafa9932e6e4d7f5ba033a2b79afe29d | [
"MIT"
] | null | null | null | src/regularization_utils.py | uditgupta002/RegularizationMethodsForNN | 2554e088bafa9932e6e4d7f5ba033a2b79afe29d | [
"MIT"
] | null | null | null | '''
Created on Nov 7, 2017
@author: udit.gupta
'''
import numpy as np
import matplotlib.pyplot as plt
import h5py
import sklearn
import sklearn.datasets
import sklearn.linear_model
import scipy.io
def sigmoid(x):
"""
Compute the sigmoid of x
Arguments:
x -- A scalar or numpy array of any size.
R... | 31.5 | 120 | 0.581175 | import numpy as np
import matplotlib.pyplot as plt
import h5py
import sklearn
import sklearn.datasets
import sklearn.linear_model
import scipy.io
def sigmoid(x):
s = 1/(1+np.exp(-x))
return s
def relu(x):
s = np.maximum(0,x)
return s
def load_planar_dataset(seed):
np.random.seed(seed)
... | true | true |
1c1998452aacdf765ac5aefc52f94f1073c7d675 | 214 | py | Python | models/models_base.py | deepeshhada/HyperTeNet | 001c8ea103e294d90c34702f2f55e6c20c7cc6c0 | [
"Apache-2.0"
] | 5 | 2021-11-21T23:19:58.000Z | 2022-01-17T11:19:30.000Z | models/models_base.py | deepeshhada/HyperTeNet | 001c8ea103e294d90c34702f2f55e6c20c7cc6c0 | [
"Apache-2.0"
] | null | null | null | models/models_base.py | deepeshhada/HyperTeNet | 001c8ea103e294d90c34702f2f55e6c20c7cc6c0 | [
"Apache-2.0"
] | null | null | null | from models.hypertenet import HyperTeNet
class Models(object):
def __init__(self, params, device='cuda:0'):
self.model = HyperTeNet(params, device)
def get_model(self):
return self.model
| 21.4 | 48 | 0.686916 | from models.hypertenet import HyperTeNet
class Models(object):
def __init__(self, params, device='cuda:0'):
self.model = HyperTeNet(params, device)
def get_model(self):
return self.model
| true | true |
1c19989e070245a4a931a40a81b021a571e0d0bf | 3,179 | py | Python | parallel/3-ACER/worker.py | g6ling/Pytorch-Cartpole | ecb7b622cfefe825ac95388cceb6752413d90a2a | [
"MIT"
] | 116 | 2019-01-08T02:35:42.000Z | 2022-03-16T07:24:06.000Z | parallel/3-ACER/worker.py | g6ling/Pytorch-Cartpole-Example | ecb7b622cfefe825ac95388cceb6752413d90a2a | [
"MIT"
] | 3 | 2019-10-24T17:34:38.000Z | 2021-07-09T06:22:20.000Z | parallel/3-ACER/worker.py | g6ling/Pytorch-Cartpole-Example | ecb7b622cfefe825ac95388cceb6752413d90a2a | [
"MIT"
] | 21 | 2019-01-29T11:14:45.000Z | 2021-09-13T15:38:18.000Z | import gym
import torch
import torch.multiprocessing as mp
import numpy as np
from model import LocalModel
from memory import Memory, Trajectory
from config import env_name, max_episode, log_interval, replay_memory_capacity, replay_ratio
class Worker(mp.Process):
def __init__(self, global_model, global_average_mod... | 36.54023 | 156 | 0.634162 | import gym
import torch
import torch.multiprocessing as mp
import numpy as np
from model import LocalModel
from memory import Memory, Trajectory
from config import env_name, max_episode, log_interval, replay_memory_capacity, replay_ratio
class Worker(mp.Process):
def __init__(self, global_model, global_average_mod... | true | true |
1c1998ec73a708fdc3a600307d90456df0c1360f | 13,334 | py | Python | suave/migrations/0013_auto__del_carouselimage__del_carousel__add_imagecarouselimage__add_ima.py | radiosilence/django-suave | 19eb23de0589bdce68f91d580c53da179835ed90 | [
"MIT"
] | null | null | null | suave/migrations/0013_auto__del_carouselimage__del_carousel__add_imagecarouselimage__add_ima.py | radiosilence/django-suave | 19eb23de0589bdce68f91d580c53da179835ed90 | [
"MIT"
] | 1 | 2020-09-25T07:00:39.000Z | 2020-09-28T06:51:09.000Z | suave/migrations/0013_auto__del_carouselimage__del_carousel__add_imagecarouselimage__add_ima.py | radiosilence/django-suave | 19eb23de0589bdce68f91d580c53da179835ed90 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'CarouselImage'
db.delete_table('suave_carouselimage')
# Deleting model 'Carousel'... | 75.333333 | 163 | 0.573796 |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.delete_table('suave_carouselimage')
db.delete_table('suave_carousel')
db.create_table('suav... | true | true |
1c199a3493c832a4ed6918b0e323e9ee80fd03a3 | 6,960 | py | Python | trkbot.py | fg1/telegram-trkbot | 09e3b32e30238ef271570408c3edb8ce30040714 | [
"MIT"
] | 1 | 2018-02-12T01:17:35.000Z | 2018-02-12T01:17:35.000Z | trkbot.py | fg1/telegram-trkbot | 09e3b32e30238ef271570408c3edb8ce30040714 | [
"MIT"
] | null | null | null | trkbot.py | fg1/telegram-trkbot | 09e3b32e30238ef271570408c3edb8ce30040714 | [
"MIT"
] | 1 | 2020-02-04T13:13:46.000Z | 2020-02-04T13:13:46.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*+
import logging
import datetime
from peewee import *
from emoji import emojize
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, ReplyKeyboardMarkup
from telegram.ext import Updater, Job, CallbackQueryHandler
from telegram.ext import CommandHandler, Message... | 30 | 153 | 0.64454 |
import logging
import datetime
from peewee import *
from emoji import emojize
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, ReplyKeyboardMarkup
from telegram.ext import Updater, Job, CallbackQueryHandler
from telegram.ext import CommandHandler, MessageHandler, Filters
from functools import wraps
f... | true | true |
1c199c15aa189338a97e46dbf59cb266c36500f1 | 4,671 | py | Python | sktime/forecasting/hcrystalball.py | marcio55afr/sktime | 25ba2f470f037366ca6b0e529137d3d0a6191e2e | [
"BSD-3-Clause"
] | 5,349 | 2019-03-21T14:56:50.000Z | 2022-03-31T11:25:30.000Z | sktime/forecasting/hcrystalball.py | marcio55afr/sktime | 25ba2f470f037366ca6b0e529137d3d0a6191e2e | [
"BSD-3-Clause"
] | 1,803 | 2019-03-26T13:33:53.000Z | 2022-03-31T23:58:10.000Z | sktime/forecasting/hcrystalball.py | marcio55afr/sktime | 25ba2f470f037366ca6b0e529137d3d0a6191e2e | [
"BSD-3-Clause"
] | 911 | 2019-03-25T01:21:30.000Z | 2022-03-31T04:45:51.000Z | # -*- coding: utf-8 -*-
# !/usr/bin/env python3 -u
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Implements wrapper for using HCrystalBall forecastsers in sktime."""
import pandas as pd
from sklearn.base import clone
from sktime.forecasting.base._base import DEFAULT_ALPHA
from sktime.fore... | 27.315789 | 84 | 0.627061 |
import pandas as pd
from sklearn.base import clone
from sktime.forecasting.base._base import DEFAULT_ALPHA
from sktime.forecasting.base import BaseForecaster
from sktime.utils.validation._dependencies import _check_soft_dependencies
_check_soft_dependencies("hcrystalball")
def _check_fh(fh, cutoff):
if fh i... | true | true |
1c199c7fda8608ab8567bc39708101ec2a352119 | 757 | py | Python | Others/practice/practice2/c/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 2 | 2020-06-12T09:54:23.000Z | 2021-05-04T01:34:07.000Z | Others/practice/practice2/c/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 961 | 2020-06-23T07:26:22.000Z | 2022-03-31T21:34:52.000Z | Others/practice/practice2/c/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
# See:
# https://github.com/not522/ac-library-python/blob/master/atcoder/math.py
def floor_sum(n: int, m: int, a: int, b: int) -> int:
ans = 0
if a >= m:
ans += (n - 1) * n * (a // m) // 2
a %= m
if b >= m:
ans += n * (b // m)
b %= m
y_max = (... | 18.02381 | 73 | 0.462351 |
def floor_sum(n: int, m: int, a: int, b: int) -> int:
ans = 0
if a >= m:
ans += (n - 1) * n * (a // m) // 2
a %= m
if b >= m:
ans += n * (b // m)
b %= m
y_max = (a * n + b) // m
x_max = y_max * m - b
if y_max == 0:
return ans
ans += (n - (x_m... | true | true |
1c199ca83f2a8dc80c79af259e5e50a8d61cd291 | 2,084 | py | Python | nipype/interfaces/fsl/tests/test_auto_MotionOutliers.py | vferat/nipype | 536c57da150d157dcb5c121af43aaeab71cdbd5f | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/fsl/tests/test_auto_MotionOutliers.py | vferat/nipype | 536c57da150d157dcb5c121af43aaeab71cdbd5f | [
"Apache-2.0"
] | 2 | 2018-04-17T19:18:16.000Z | 2020-03-04T22:05:02.000Z | nipype/interfaces/fsl/tests/test_auto_MotionOutliers.py | oesteban/nipype | c14f24eba1da08711bbb894e049ee858ed740096 | [
"Apache-2.0"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..utils import MotionOutliers
def test_MotionOutliers_inputs():
input_map = dict(
args=dict(argstr='%s', ),
dummy=dict(argstr='--dummy=%d', ),
environ=dict(
nohash=True,
... | 30.647059 | 67 | 0.553743 |
from __future__ import unicode_literals
from ..utils import MotionOutliers
def test_MotionOutliers_inputs():
input_map = dict(
args=dict(argstr='%s', ),
dummy=dict(argstr='--dummy=%d', ),
environ=dict(
nohash=True,
usedefault=True,
),
in_file=dict(
... | true | true |
1c199cfcd8fedad8450e57530dec9a9335a9d042 | 270 | py | Python | webapp/post/urls.py | n3k0fi5t/ClonePttWeb | f2a5abb523c244389113b653ed20252fbcec5251 | [
"MIT"
] | null | null | null | webapp/post/urls.py | n3k0fi5t/ClonePttWeb | f2a5abb523c244389113b653ed20252fbcec5251 | [
"MIT"
] | null | null | null | webapp/post/urls.py | n3k0fi5t/ClonePttWeb | f2a5abb523c244389113b653ed20252fbcec5251 | [
"MIT"
] | null | null | null | from django.urls import re_path
from .views import BoardView, PostView
app_name = 'post'
urlpatterns = [
re_path('^(?P<board_name>\w+)/$', BoardView.as_view(), name='board'),
re_path('^(?P<board_name>\w+)/(?P<endpoint>.+)/', PostView.as_view(), name='post'),
] | 30 | 87 | 0.655556 | from django.urls import re_path
from .views import BoardView, PostView
app_name = 'post'
urlpatterns = [
re_path('^(?P<board_name>\w+)/$', BoardView.as_view(), name='board'),
re_path('^(?P<board_name>\w+)/(?P<endpoint>.+)/', PostView.as_view(), name='post'),
] | true | true |
1c199d1423b4d52f9b964137e1c6bf44b63ab84c | 724 | py | Python | image_process/algorithm.py | storyoftime66/AlgorithmSheet | 90e530a791507127a71449bdd0adcd459ced946e | [
"MIT"
] | null | null | null | image_process/algorithm.py | storyoftime66/AlgorithmSheet | 90e530a791507127a71449bdd0adcd459ced946e | [
"MIT"
] | null | null | null | image_process/algorithm.py | storyoftime66/AlgorithmSheet | 90e530a791507127a71449bdd0adcd459ced946e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
import numpy as np
# 基础算法
def C(m, n):
'''
<time>2018.11.27</time>
<summary>组合</summary>
'''
result = 1
if m*n > 0 and isinstance(m*n, int) and n > m:
for i in range(n-m+1, n+1):
result *= i
for i in range(1, m+1):
... | 18.1 | 50 | 0.475138 |
import numpy as np
def C(m, n):
result = 1
if m*n > 0 and isinstance(m*n, int) and n > m:
for i in range(n-m+1, n+1):
result *= i
for i in range(1, m+1):
result /= i
return result
def A(m, n):
result = 1
if m*n > 0 and isinstance(m*n, int) and n > m:... | true | true |
1c199d1ee013334949e27382ef2789d3cefe0171 | 14,408 | py | Python | build/lib/showdownai/simulator.py | AM22/Pokemon-AI | 4cd29eb880981613158db0055179f4395c5599e3 | [
"MIT"
] | null | null | null | build/lib/showdownai/simulator.py | AM22/Pokemon-AI | 4cd29eb880981613158db0055179f4395c5599e3 | [
"MIT"
] | null | null | null | build/lib/showdownai/simulator.py | AM22/Pokemon-AI | 4cd29eb880981613158db0055179f4395c5599e3 | [
"MIT"
] | null | null | null | from move_list import moves as MOVES
from mega_items import mega_items as MEGA_ITEMS
from log import SimulatorLog
from data import MOVE_CORRECTIONS, get_hidden_power, correct_mega, get_move
class Simulator():
def __init__(self, pokedata):
self.log = SimulatorLog()
self.smogon_data = pokedata.smogo... | 40.585915 | 168 | 0.549903 | from move_list import moves as MOVES
from mega_items import mega_items as MEGA_ITEMS
from log import SimulatorLog
from data import MOVE_CORRECTIONS, get_hidden_power, correct_mega, get_move
class Simulator():
def __init__(self, pokedata):
self.log = SimulatorLog()
self.smogon_data = pokedata.smogo... | true | true |
1c199e0916ba81d9dd81a3b28296676a2ebfa58f | 1,924 | py | Python | weboob/py/connector.py | frankrousseau/kresus | 617967e111ac4b9a13ee4524f2db2428c2dbc954 | [
"MIT"
] | null | null | null | weboob/py/connector.py | frankrousseau/kresus | 617967e111ac4b9a13ee4524f2db2428c2dbc954 | [
"MIT"
] | null | null | null | weboob/py/connector.py | frankrousseau/kresus | 617967e111ac4b9a13ee4524f2db2428c2dbc954 | [
"MIT"
] | null | null | null | from weboob.core import WebNip
DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
class Connector(object):
'''
Connector is a tool that connects to common websites like bank website,
phone operator website... and that grabs personal data from there.
Credentials are required to make this operation.
Technicall... | 33.754386 | 76 | 0.56341 | from weboob.core import WebNip
DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
class Connector(object):
'''
Connector is a tool that connects to common websites like bank website,
phone operator website... and that grabs personal data from there.
Credentials are required to make this operation.
Technicall... | false | true |
1c199f1f2607aa2ab573c29d556a9018bc2a9866 | 30,852 | py | Python | switss/model/reachability_form.py | simonjantsch/switss | 53865f218ac581b51e203becf6f26fedd0bc1326 | [
"MIT"
] | 2 | 2020-09-07T12:46:36.000Z | 2022-01-11T14:51:36.000Z | switss/model/reachability_form.py | simonjantsch/switss | 53865f218ac581b51e203becf6f26fedd0bc1326 | [
"MIT"
] | 1 | 2020-08-28T14:55:50.000Z | 2020-08-28T15:45:52.000Z | switss/model/reachability_form.py | simonjantsch/switss | 53865f218ac581b51e203becf6f26fedd0bc1326 | [
"MIT"
] | 2 | 2021-01-26T17:53:19.000Z | 2022-02-28T21:48:13.000Z | from . import AbstractMDP,MDP
from ..utils import InvertibleDict, cast_dok_matrix, DTMCVisualizationConfig, VisualizationConfig
from ..solver.milp import LP
from collections import defaultdict
from bidict import bidict
import copy as copy
import numpy as np
from scipy.sparse import dok_matrix,hstack,vstack
class Reac... | 43.51481 | 214 | 0.623558 | from . import AbstractMDP,MDP
from ..utils import InvertibleDict, cast_dok_matrix, DTMCVisualizationConfig, VisualizationConfig
from ..solver.milp import LP
from collections import defaultdict
from bidict import bidict
import copy as copy
import numpy as np
from scipy.sparse import dok_matrix,hstack,vstack
class Reac... | true | true |
1c199f2d02e76efadacdfcc42dd94efd31576dd4 | 60,629 | py | Python | python/ray/tune/trial_runner.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 1 | 2022-03-07T06:40:06.000Z | 2022-03-07T06:40:06.000Z | python/ray/tune/trial_runner.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 29 | 2021-11-24T00:50:07.000Z | 2022-03-19T07:11:36.000Z | python/ray/tune/trial_runner.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | null | null | null | from typing import Any, List, Mapping, Optional, Union
import click
from datetime import datetime
import json
import logging
import os
import time
import traceback
import warnings
import ray
from ray.exceptions import RayTaskError
from ray.tune.error import TuneStopTrialError
from ray.tune.impl.out_of_band_serialize_... | 40.690604 | 94 | 0.60481 | from typing import Any, List, Mapping, Optional, Union
import click
from datetime import datetime
import json
import logging
import os
import time
import traceback
import warnings
import ray
from ray.exceptions import RayTaskError
from ray.tune.error import TuneStopTrialError
from ray.tune.impl.out_of_band_serialize_... | true | true |
1c19a021c0e5d1698c17c84bcf1d94f7446130a6 | 4,462 | py | Python | configs/UCAS_AOD/LibraAtt_retinanet_obb_r50_fpn_2x_UCAS_AOD.py | mmoghadam11/ReDet | 917d370c827b65f0dc3618899290fd9288f30f64 | [
"Apache-2.0"
] | 1 | 2021-08-04T11:30:08.000Z | 2021-08-04T11:30:08.000Z | configs/UCAS_AOD/LibraAtt_retinanet_obb_r50_fpn_2x_UCAS_AOD.py | mmoghadam11/ReDet | 917d370c827b65f0dc3618899290fd9288f30f64 | [
"Apache-2.0"
] | null | null | null | configs/UCAS_AOD/LibraAtt_retinanet_obb_r50_fpn_2x_UCAS_AOD.py | mmoghadam11/ReDet | 917d370c827b65f0dc3618899290fd9288f30f64 | [
"Apache-2.0"
] | null | null | null | # model settings
model = dict(
type='RetinaNetRbbox',
pretrained='modelzoo://resnet50',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
style='pytorch'),
# neck=dict(
# type='FPN',
# in_chann... | 29.946309 | 118 | 0.553563 |
model = dict(
type='RetinaNetRbbox',
pretrained='modelzoo://resnet50',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
style='pytorch'),
| true | true |
1c19a051d32498b9a9f5e93794eb6d65d627cdc8 | 20,118 | py | Python | src/python/pants/engine/internals/engine_test.py | MEDIARITHMICS/pants | 8b2ad3263b73686832dab0bfffe44b9b1a1adbb3 | [
"Apache-2.0"
] | null | null | null | src/python/pants/engine/internals/engine_test.py | MEDIARITHMICS/pants | 8b2ad3263b73686832dab0bfffe44b9b1a1adbb3 | [
"Apache-2.0"
] | null | null | null | src/python/pants/engine/internals/engine_test.py | MEDIARITHMICS/pants | 8b2ad3263b73686832dab0bfffe44b9b1a1adbb3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import itertools
import time
import unittest
from dataclasses import dataclass, field
from textwrap import dedent
from typing import List
from pants.engine.fs import EMPTY_DIGEST
from pan... | 33.983108 | 128 | 0.62889 |
import itertools
import time
import unittest
from dataclasses import dataclass, field
from textwrap import dedent
from typing import List
from pants.engine.fs import EMPTY_DIGEST
from pants.engine.internals.scheduler import ExecutionError
from pants.engine.internals.scheduler_test_base import SchedulerTestBase
from... | true | true |
1c19a0d4807230f776d76e0b81536cafffd59872 | 757 | py | Python | utils.py | ruivieira/workshop-recommendation-engines | 64e0f9f0dce83fcb3b4110c20f001b6e37aef1d2 | [
"Apache-2.0"
] | 2 | 2019-01-27T09:42:31.000Z | 2021-08-25T09:42:10.000Z | utils.py | sophwats/workshop-recommendation-engines | 3efe678856dde1862cf6262ad1117aaa7b506265 | [
"Apache-2.0"
] | null | null | null | utils.py | sophwats/workshop-recommendation-engines | 3efe678856dde1862cf6262ad1117aaa7b506265 | [
"Apache-2.0"
] | 4 | 2019-01-21T21:34:36.000Z | 2019-01-27T09:46:13.000Z | import csv
from scipy import sparse
import numpy as np
def load_data(path):
max_movie = 0
max_user = 0
data = []
pairs = []
with open(path, 'rt') as csvfile:
reader = csv.reader(csvfile, delimiter=',', quotechar='"')
next(reader, None)
for row in reader:
movie_id... | 29.115385 | 66 | 0.562748 | import csv
from scipy import sparse
import numpy as np
def load_data(path):
max_movie = 0
max_user = 0
data = []
pairs = []
with open(path, 'rt') as csvfile:
reader = csv.reader(csvfile, delimiter=',', quotechar='"')
next(reader, None)
for row in reader:
movie_id... | true | true |
1c19a2222c773cea55099a488687ff8eb944d444 | 376 | py | Python | python--exercicios/ex090.py | Eliezer2000/python | 12abb54c6536acb2f36b8f34bf51ec765857eb75 | [
"MIT"
] | null | null | null | python--exercicios/ex090.py | Eliezer2000/python | 12abb54c6536acb2f36b8f34bf51ec765857eb75 | [
"MIT"
] | null | null | null | python--exercicios/ex090.py | Eliezer2000/python | 12abb54c6536acb2f36b8f34bf51ec765857eb75 | [
"MIT"
] | null | null | null | aluno = dict()
aluno['Nome'] = str(input('Nome : '))
aluno['Média'] = float(input(f'Média de {aluno["Nome"]} : '))
if aluno['Média'] >= 7:
aluno['Situação'] = 'Aprovado'
elif 5 <= aluno['Média'] < 7:
aluno['Situação'] = 'Recuperação'
else:
aluno['Situação'] = 'Reprovado'
print('=-'* 60)
for k, v in aluno.it... | 14.461538 | 61 | 0.547872 | aluno = dict()
aluno['Nome'] = str(input('Nome : '))
aluno['Média'] = float(input(f'Média de {aluno["Nome"]} : '))
if aluno['Média'] >= 7:
aluno['Situação'] = 'Aprovado'
elif 5 <= aluno['Média'] < 7:
aluno['Situação'] = 'Recuperação'
else:
aluno['Situação'] = 'Reprovado'
print('=-'* 60)
for k, v in aluno.it... | true | true |
1c19a2ef25a511634a7e516f5e46246a0b223680 | 334 | py | Python | tests/mocks/test_client.py | davidesner/sapi-python-client | 0f16fa30cb93e6dc99b16e983c139f9c3abee67e | [
"MIT"
] | 3 | 2017-07-13T13:17:37.000Z | 2017-11-08T19:01:29.000Z | tests/mocks/test_client.py | davidesner/sapi-python-client | 0f16fa30cb93e6dc99b16e983c139f9c3abee67e | [
"MIT"
] | 45 | 2017-07-13T07:49:51.000Z | 2021-08-19T15:43:39.000Z | tests/mocks/test_client.py | davidesner/sapi-python-client | 0f16fa30cb93e6dc99b16e983c139f9c3abee67e | [
"MIT"
] | 5 | 2017-07-14T05:50:49.000Z | 2021-12-28T17:01:29.000Z | import unittest
from kbcstorage.client import Client
class TestClient(unittest.TestCase):
def test_token_not_updatable(self):
"Token raises attribute error when updated"
client = Client('https://example.com', 'password')
with self.assertRaises(AttributeError):
client.token = '... | 27.833333 | 58 | 0.703593 | import unittest
from kbcstorage.client import Client
class TestClient(unittest.TestCase):
def test_token_not_updatable(self):
client = Client('https://example.com', 'password')
with self.assertRaises(AttributeError):
client.token = 'new-password'
| true | true |
1c19a3b25e58641da2ae11b42d43fff7c73c269a | 1,752 | py | Python | .install/.backup/platform/gsutil/third_party/boto/boto/kinesis/__init__.py | bopopescu/google-cloud-sdk | b34e6a18f1e89673508166acce816111c3421e4b | [
"Apache-2.0"
] | 1 | 2017-11-18T18:23:22.000Z | 2017-11-18T18:23:22.000Z | taskqueue/venv_tq/lib/python2.7/site-packages/boto/kinesis/__init__.py | matthappens/taskqueue | 548979587326b95bf41851eb135052de782e74fc | [
"MIT"
] | null | null | null | taskqueue/venv_tq/lib/python2.7/site-packages/boto/kinesis/__init__.py | matthappens/taskqueue | 548979587326b95bf41851eb135052de782e74fc | [
"MIT"
] | 1 | 2020-07-24T20:04:47.000Z | 2020-07-24T20:04:47.000Z | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights... | 38.086957 | 74 | 0.72089 |
from boto.regioninfo import RegionInfo
def regions():
from boto.kinesis.layer1 import KinesisConnection
return [RegionInfo(name='us-east-1',
endpoint='kinesis.us-east-1.amazonaws.com',
connection_cls=KinesisConnection),
]
def c... | true | true |
1c19a3d0bf78b87f1c2527eef4b04b15116e986b | 812 | py | Python | mypackage/hello.py | jototland/example_python_package | 56fdc81559879eed203fb1947468574d59e9be5a | [
"WTFPL"
] | null | null | null | mypackage/hello.py | jototland/example_python_package | 56fdc81559879eed203fb1947468574d59e9be5a | [
"WTFPL"
] | null | null | null | mypackage/hello.py | jototland/example_python_package | 56fdc81559879eed203fb1947468574d59e9be5a | [
"WTFPL"
] | null | null | null | # This is hello.py
#
# It contains a single function, which prints a greeting, twice.
#
# Instead of hardcoding the greetings, they are read (using
# `importlib.resources`) from text files contained inside this package.
#
# I demonstrate two methods of doing this below. Only the bottom method will
# work with files con... | 32.48 | 89 | 0.713054 |
import importlib.resources as r
def hello():
with r.open_text('mypackage', 'hello.txt', encoding='utf-8') as f:
msg = f.read().strip()
print(msg)
msg = (r.files('mypackage') / 'subdir/hello.txt').read_text(encoding='utf-8').strip()
print (msg)
| true | true |
1c19a466cc7dba326d591236b23a50f86502c3df | 118 | wsgi | Python | application/flaskapp.wsgi | dcollan/Gator-Grub | e46b81ab93dc5296679ee8bb6a203c2d1a2c69f3 | [
"MIT"
] | null | null | null | application/flaskapp.wsgi | dcollan/Gator-Grub | e46b81ab93dc5296679ee8bb6a203c2d1a2c69f3 | [
"MIT"
] | null | null | null | application/flaskapp.wsgi | dcollan/Gator-Grub | e46b81ab93dc5296679ee8bb6a203c2d1a2c69f3 | [
"MIT"
] | null | null | null | import sys
sys.path.insert(0, "/var/www/html/csc648-03-sp21-Team02/application")
from main import app as application
| 23.6 | 69 | 0.779661 | import sys
sys.path.insert(0, "/var/www/html/csc648-03-sp21-Team02/application")
from main import app as application
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.