hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f741cd044565638f0f41ced3c9cb9c5e4150ede0 | 273 | py | Python | main.py | joroGER/schafkopf-ml | 24e25fdef18d120b2a4678976cfcb9c7c164dc02 | [
"Apache-2.0"
] | 1 | 2022-01-19T23:57:43.000Z | 2022-01-19T23:57:43.000Z | main.py | jonrosner/schafkopf-ml | 24e25fdef18d120b2a4678976cfcb9c7c164dc02 | [
"Apache-2.0"
] | null | null | null | main.py | jonrosner/schafkopf-ml | 24e25fdef18d120b2a4678976cfcb9c7c164dc02 | [
"Apache-2.0"
] | 1 | 2019-11-21T19:16:19.000Z | 2019-11-21T19:16:19.000Z | from match import Match
from rl_agent import Rl_Agent
def init():
num_players = 3
rl_agent = Rl_Agent()
match = Match(num_players, rl_agent)
rl_agent.set_match(match)
match.start()
match.run()
match.end()
if __name__ == '__main__':
init()
| 18.2 | 40 | 0.659341 | from match import Match
from rl_agent import Rl_Agent
def init():
num_players = 3
rl_agent = Rl_Agent()
match = Match(num_players, rl_agent)
rl_agent.set_match(match)
match.start()
match.run()
match.end()
if __name__ == '__main__':
init()
| true | true |
f741cdbce366465d78cc1b2db6d6b80ab078f890 | 7,892 | py | Python | ocrd/ocrd/resolver.py | b2m/core | 9c5bbbac0f7bd0e0017870b8cafa0954d842d844 | [
"Apache-2.0"
] | null | null | null | ocrd/ocrd/resolver.py | b2m/core | 9c5bbbac0f7bd0e0017870b8cafa0954d842d844 | [
"Apache-2.0"
] | null | null | null | ocrd/ocrd/resolver.py | b2m/core | 9c5bbbac0f7bd0e0017870b8cafa0954d842d844 | [
"Apache-2.0"
] | null | null | null | import tempfile
from pathlib import Path
import requests
from ocrd.constants import TMP_PREFIX
from ocrd_utils import (
getLogger,
is_local_filename,
get_local_filename,
remove_non_path_from_url,
nth_url_segment
)
from ocrd.workspace import Workspace
from ocrd_models import OcrdMets
from ocrd_mode... | 43.125683 | 136 | 0.638115 | import tempfile
from pathlib import Path
import requests
from ocrd.constants import TMP_PREFIX
from ocrd_utils import (
getLogger,
is_local_filename,
get_local_filename,
remove_non_path_from_url,
nth_url_segment
)
from ocrd.workspace import Workspace
from ocrd_models import OcrdMets
from ocrd_mode... | true | true |
f741cfdf02646f0f9644dd24dc6435731cb5c6bf | 408 | py | Python | randline.py | BartMassey/randline | 1c47d4bab8201085448768cfaf6ac943c41f8bd0 | [
"MIT"
] | null | null | null | randline.py | BartMassey/randline | 1c47d4bab8201085448768cfaf6ac943c41f8bd0 | [
"MIT"
] | 9 | 2018-01-19T16:51:24.000Z | 2018-01-19T22:29:23.000Z | randline.py | BartMassey/randline | 1c47d4bab8201085448768cfaf6ac943c41f8bd0 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# Copyright (c) 2018 Bart Massey
# [This program is licensed under the "MIT License"]
# Please see the file LICENSE in the source
# distribution of this software for license terms.
# Print a random line from stdin.
from sys import stdin
from random import randrange
lines = list(stdin)
line = lines... | 24 | 52 | 0.705882 |
from sys import stdin
from random import randrange
lines = list(stdin)
line = lines[randrange(len(lines))]
if line[-1] != '\n':
line = line + "\n"
print(line, end="")
| true | true |
f741d09d126e46698aca443e601e83c37a6951e3 | 446 | py | Python | cov19/urls.py | chapla/cov19- | 59525f4e8afa4675ce87d08f26cb406f84df20c7 | [
"Apache-2.0"
] | null | null | null | cov19/urls.py | chapla/cov19- | 59525f4e8afa4675ce87d08f26cb406f84df20c7 | [
"Apache-2.0"
] | null | null | null | cov19/urls.py | chapla/cov19- | 59525f4e8afa4675ce87d08f26cb406f84df20c7 | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import url
from cov19 import views
urlpatterns = [
url('map', views.reptile,name='map'),
url('time', views.time1,name='history'),
url('index', views.index,name='index'),
url('move', views.move,name='move'),
url('wordcloud', views.wordc,name='wordcloud'),
url('line',... | 34.307692 | 52 | 0.630045 | from django.conf.urls import url
from cov19 import views
urlpatterns = [
url('map', views.reptile,name='map'),
url('time', views.time1,name='history'),
url('index', views.index,name='index'),
url('move', views.move,name='move'),
url('wordcloud', views.wordc,name='wordcloud'),
url('line',... | true | true |
f741d0f384cdacd404d46902c06c7568f43a06ae | 1,820 | py | Python | tests/str_util_test.py | geekcampchina/happy-python | b421d29952bf76158375353b896dfb5eb814b948 | [
"MIT"
] | 1 | 2020-10-14T11:10:02.000Z | 2020-10-14T11:10:02.000Z | tests/str_util_test.py | geekcampchina/happy-python | b421d29952bf76158375353b896dfb5eb814b948 | [
"MIT"
] | null | null | null | tests/str_util_test.py | geekcampchina/happy-python | b421d29952bf76158375353b896dfb5eb814b948 | [
"MIT"
] | 1 | 2019-11-25T07:59:26.000Z | 2019-11-25T07:59:26.000Z | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
import unittest
from happy_python import bytearray_to_str, gen_random_str, to_hex_str1, is_ascii_str, to_hex_str2, \
from_hex_str
from happy_python import bytes_to_str
from happy_python import dict_to_str
from happy_python import str_to_dict
class TestUtils(unittes... | 35 | 100 | 0.660989 |
import unittest
from happy_python import bytearray_to_str, gen_random_str, to_hex_str1, is_ascii_str, to_hex_str2, \
from_hex_str
from happy_python import bytes_to_str
from happy_python import dict_to_str
from happy_python import str_to_dict
class TestUtils(unittest.TestCase):
def test_bytes_to_str(self):
... | true | true |
f741d1c7b94a0ebb8525bf01d11c2abd7ce63821 | 543 | py | Python | tests/test_add_contact.py | OlgaLa/task_1 | 6474c437cefe88ca6ba08b6bd5eba605c665508c | [
"Apache-2.0"
] | null | null | null | tests/test_add_contact.py | OlgaLa/task_1 | 6474c437cefe88ca6ba08b6bd5eba605c665508c | [
"Apache-2.0"
] | null | null | null | tests/test_add_contact.py | OlgaLa/task_1 | 6474c437cefe88ca6ba08b6bd5eba605c665508c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from model.parameters import *
def test_add_contact(app, db, check_ui, json_contacts):
contact = json_contacts
old_contacts = db.get_contact_list()
app.contact.create_new_contact(contact)
new_contacts = db.get_contact_list()
old_contacts.append(contact)
assert sorted(ol... | 33.9375 | 121 | 0.740331 |
from model.parameters import *
def test_add_contact(app, db, check_ui, json_contacts):
contact = json_contacts
old_contacts = db.get_contact_list()
app.contact.create_new_contact(contact)
new_contacts = db.get_contact_list()
old_contacts.append(contact)
assert sorted(old_contacts, key=Contact... | true | true |
f741d21d8e93d167909cd90717c9398317626e2c | 1,042 | py | Python | glad/lang/d/loader/glx.py | solarane/glad | f161fb6474374207b2a719009e304946bd283d24 | [
"Apache-2.0"
] | 2,592 | 2015-01-14T20:38:54.000Z | 2022-03-30T12:10:56.000Z | glad/lang/d/loader/glx.py | solarane/glad | f161fb6474374207b2a719009e304946bd283d24 | [
"Apache-2.0"
] | 338 | 2015-01-21T13:11:04.000Z | 2022-03-31T08:18:57.000Z | glad/lang/d/loader/glx.py | solarane/glad | f161fb6474374207b2a719009e304946bd283d24 | [
"Apache-2.0"
] | 454 | 2015-01-19T11:53:56.000Z | 2022-03-29T22:15:27.000Z | from glad.lang.common.loader import BaseLoader
from glad.lang.d.loader import LOAD_OPENGL_DLL
_GLX_LOADER = \
LOAD_OPENGL_DLL % {'pre':'private', 'init':'open_gl',
'proc':'get_proc', 'terminate':'close_gl'} + '''
bool gladLoadGLX() {
bool status = false;
if(open_gl()) {
sta... | 20.84 | 71 | 0.603647 | from glad.lang.common.loader import BaseLoader
from glad.lang.d.loader import LOAD_OPENGL_DLL
_GLX_LOADER = \
LOAD_OPENGL_DLL % {'pre':'private', 'init':'open_gl',
'proc':'get_proc', 'terminate':'close_gl'} + '''
bool gladLoadGLX() {
bool status = false;
if(open_gl()) {
sta... | true | true |
f741d23dccbefd28aeb81ef6a28e027b5c3165bb | 1,296 | py | Python | es/es_del_index.py | GITHUBCYB97/BERT-Embedding-Frequently-Asked-Question | c32cd7287b4d5e618b3bdcbf1d0258eabd279e49 | [
"Apache-2.0"
] | 33 | 2020-07-13T10:14:00.000Z | 2021-03-31T06:38:46.000Z | es/es_del_index.py | GITHUBCYB97/BERT-Embedding-Frequently-Asked-Question | c32cd7287b4d5e618b3bdcbf1d0258eabd279e49 | [
"Apache-2.0"
] | 11 | 2021-05-21T06:48:50.000Z | 2022-01-18T13:38:53.000Z | es/es_del_index.py | GITHUBCYB97/BERT-Embedding-Frequently-Asked-Question | c32cd7287b4d5e618b3bdcbf1d0258eabd279e49 | [
"Apache-2.0"
] | 12 | 2020-08-17T06:00:43.000Z | 2021-03-04T08:50:30.000Z | # coding=UTF-8
'''
@Author: xiaoyichao
LastEditors: xiaoyichao
@Date: 2020-01-02 16:55:23
LastEditTime: 2021-06-06 21:54:28
@Description: 删除ES的索引, del_index_name 是要删除的索引的名字
'''
from es_operate import ESCURD
from elasticsearch import Elasticsearch
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os... | 27.574468 | 79 | 0.772377 |
from es_operate import ESCURD
from elasticsearch import Elasticsearch
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import configparser
import os
import sys
dir_name = os.path.abspath(os.path.dirname(__file__))
es_config = configparser.ConfigParser()
es_config.rea... | true | true |
f741d28c120ea874d240f15469308faf34286a81 | 3,151 | py | Python | src/radical/ensemblemd/kernel_plugins/misc/diff.py | chemlove/radical.ensemblemd | 0ec4b127760d2fee88d4eae1768fecec4bdd6b21 | [
"MIT"
] | null | null | null | src/radical/ensemblemd/kernel_plugins/misc/diff.py | chemlove/radical.ensemblemd | 0ec4b127760d2fee88d4eae1768fecec4bdd6b21 | [
"MIT"
] | null | null | null | src/radical/ensemblemd/kernel_plugins/misc/diff.py | chemlove/radical.ensemblemd | 0ec4b127760d2fee88d4eae1768fecec4bdd6b21 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""A kernel that compares two ASCII files and outputs the differences in a detailed
format.
"""
__author__ = "Ioannis Paraskevakos <i.paraskev@rutgers.edu>"
__copyright__ = "Copyright 2014, http://radical.rutgers.edu"
__license__ = "MIT"
from copy import deepcopy
from radical.ensemblem... | 33.88172 | 109 | 0.458267 |
__author__ = "Ioannis Paraskevakos <i.paraskev@rutgers.edu>"
__copyright__ = "Copyright 2014, http://radical.rutgers.edu"
__license__ = "MIT"
from copy import deepcopy
from radical.ensemblemd.exceptions import ArgumentError
from radical.ensemblemd.exceptions import NoKernelConfigurationError
from radical.ense... | true | true |
f741d4d3b2757709f44a27592de4292ec50df2e9 | 8,396 | py | Python | iact_dnn_utils.py | dima137/iact_dnn | b0e71877cd3d6e9a1b8871dc0cbd85c16c29a84d | [
"MIT"
] | null | null | null | iact_dnn_utils.py | dima137/iact_dnn | b0e71877cd3d6e9a1b8871dc0cbd85c16c29a84d | [
"MIT"
] | null | null | null | iact_dnn_utils.py | dima137/iact_dnn | b0e71877cd3d6e9a1b8871dc0cbd85c16c29a84d | [
"MIT"
] | null | null | null | import numpy as np
import h5py
import time
import os
# functions (to be moved to utils.py)
def add_meta_keys(fn, pars_keys, image_keys=[]):
with h5py.File(fn, 'r') as f:
for key in f.keys():
if key not in pars_keys and key not in image_keys:
pars_keys.append(key)
return 0
... | 35.42616 | 101 | 0.573368 | import numpy as np
import h5py
import time
import os
def add_meta_keys(fn, pars_keys, image_keys=[]):
with h5py.File(fn, 'r') as f:
for key in f.keys():
if key not in pars_keys and key not in image_keys:
pars_keys.append(key)
return 0
def get_square_images_fn(cdict, file... | true | true |
f741d552afb12db728ad56ab728fa5d438f677ff | 21,061 | py | Python | src/ccapi/api/client.py | cellcollective/ccapi | a7649f589cfc66e05d4610c4995bd1c75ad265eb | [
"MIT"
] | 9 | 2020-05-12T08:16:35.000Z | 2022-01-06T03:22:18.000Z | src/ccapi/api/client.py | cellcollective/ccapi | a7649f589cfc66e05d4610c4995bd1c75ad265eb | [
"MIT"
] | 3 | 2020-10-14T16:29:24.000Z | 2021-10-04T07:24:34.000Z | src/ccapi/api/client.py | cellcollective/ccapi | a7649f589cfc66e05d4610c4995bd1c75ad265eb | [
"MIT"
] | null | null | null | # imports - standard imports
import sys
import os.path as osp
import random
import collections
# imports - third-party imports
from ccapi.util.gevent import patch
patch()
import requests
# from requests_cache.core import CachedSession
import grequests as greq
from grequests import AsyncRequest... | 33.64377 | 138 | 0.48464 |
import sys
import os.path as osp
import random
import collections
from ccapi.util.gevent import patch
patch()
import requests
import grequests as greq
from grequests import AsyncRequest
from ccapi.util.environ import getenv
from ccapi.api.helper import (
_build_model_urls,
... | true | true |
f741d739f1648a8af1092ff7960e5ab84e2a902e | 12,524 | py | Python | amparex/model/article_type_search_query.py | Inch4Tk/amparex_python_api | f372c15a1e67293329bdd8bee8ad66624ed1341f | [
"Apache-2.0"
] | null | null | null | amparex/model/article_type_search_query.py | Inch4Tk/amparex_python_api | f372c15a1e67293329bdd8bee8ad66624ed1341f | [
"Apache-2.0"
] | null | null | null | amparex/model/article_type_search_query.py | Inch4Tk/amparex_python_api | f372c15a1e67293329bdd8bee8ad66624ed1341f | [
"Apache-2.0"
] | null | null | null | """
AMPAREX Rest API Documentation
This is the description of the AMPAREX Rest API. All REST calls plus the corresponding data model are described in this documentation. Direct calls to the server are possible over this page.<br/>Following steps are needed to use the API:<br/><br/>1. Get the ... | 48.921875 | 1,241 | 0.592702 |
import re
import sys
from amparex.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
from ..mod... | true | true |
f741d7f9a9e15906bb744e7e01ee156ac6f28090 | 1,995 | py | Python | 200-299/215-kth-largest-element.py | bcongdon/leetcode | a6bf406c044ed7ed9e4a6910407dff01a9c6bd17 | [
"MIT"
] | 4 | 2016-10-17T22:14:32.000Z | 2021-08-18T21:10:25.000Z | 200-299/215-kth-largest-element.py | bcongdon/leetcode | a6bf406c044ed7ed9e4a6910407dff01a9c6bd17 | [
"MIT"
] | null | null | null | 200-299/215-kth-largest-element.py | bcongdon/leetcode | a6bf406c044ed7ed9e4a6910407dff01a9c6bd17 | [
"MIT"
] | null | null | null | from random import randint
class Solution(object):
def findKthLargest(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: int
"""
left = 0
right = len(nums) - 1
while left <= right:
pivot_idx = randint(left, right)
... | 37.641509 | 79 | 0.625564 | from random import randint
class Solution(object):
def findKthLargest(self, nums, k):
left = 0
right = len(nums) - 1
while left <= right:
pivot_idx = randint(left, right)
new_pivot = self.partitionAroundIndex(nums, left, right, pivot_idx)
if new_pivot ==... | true | true |
f741d801068d80d286443b058cb82a831c7b927c | 7,156 | py | Python | DRLAgentsTournament_ROUND1_3.py | parksurk/skcc-drl-sc2-course-2020_1st | 951d09424b93c76093bab51ed6aaa75eb545152e | [
"MIT"
] | null | null | null | DRLAgentsTournament_ROUND1_3.py | parksurk/skcc-drl-sc2-course-2020_1st | 951d09424b93c76093bab51ed6aaa75eb545152e | [
"MIT"
] | null | null | null | DRLAgentsTournament_ROUND1_3.py | parksurk/skcc-drl-sc2-course-2020_1st | 951d09424b93c76093bab51ed6aaa75eb545152e | [
"MIT"
] | null | null | null | import random
import time
import math
import os.path
import numpy as np
import pandas as pd
from pysc2.agents import base_agent
from pysc2.env import sc2_env, run_loop
from pysc2.lib import actions, features, units
from absl import app
from baseline.sc2.agent.DRLAgentWithVanillaDQN import TerranRLAgentWithRawActsA... | 40.202247 | 108 | 0.582588 | import random
import time
import math
import os.path
import numpy as np
import pandas as pd
from pysc2.agents import base_agent
from pysc2.env import sc2_env, run_loop
from pysc2.lib import actions, features, units
from absl import app
from baseline.sc2.agent.DRLAgentWithVanillaDQN import TerranRLAgentWithRawActsA... | true | true |
f741d8913f2c18a625f8baff0b204f6a415c5336 | 11,262 | py | Python | esrally/driver/scheduler.py | isabella232/rally | 430f6aac23ddb100ab5dac37e109a75308ba4b1c | [
"Apache-2.0"
] | null | null | null | esrally/driver/scheduler.py | isabella232/rally | 430f6aac23ddb100ab5dac37e109a75308ba4b1c | [
"Apache-2.0"
] | 1 | 2021-02-23T15:53:47.000Z | 2021-02-23T15:53:47.000Z | esrally/driver/scheduler.py | isabella232/rally | 430f6aac23ddb100ab5dac37e109a75308ba4b1c | [
"Apache-2.0"
] | null | null | null | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | 37.54 | 134 | 0.688954 |
import inspect
import logging
import random
import types
from abc import ABC, abstractmethod
import esrally.track
from esrally import exceptions
__SCHEDULERS = {}
def scheduler_for(task: esrally.track.Task):
logger = logging.getLogger(__name__)
if not task.throttled:
return Unthro... | true | true |
f741d90c8602ef97cc433cdd844ea1385016c6c3 | 3,884 | py | Python | main.py | pidor228hui/lp4 | 0b980b6f3f89403a5f4c6804f8038b5170b8b9d6 | [
"MIT"
] | null | null | null | main.py | pidor228hui/lp4 | 0b980b6f3f89403a5f4c6804f8038b5170b8b9d6 | [
"MIT"
] | null | null | null | main.py | pidor228hui/lp4 | 0b980b6f3f89403a5f4c6804f8038b5170b8b9d6 | [
"MIT"
] | null | null | null | import argparse
import traceback
import json
import requests
from vkbottle.api import UserApi
from vkbottle.user import User
from logger import logger, Logger, LoggerLevel
import const
from commands import commands_bp
from error_handlers import error_handlers_bp
from objects.json_orm import Database, DatabaseError
fr... | 26.60274 | 110 | 0.636972 | import argparse
import traceback
import json
import requests
from vkbottle.api import UserApi
from vkbottle.user import User
from logger import logger, Logger, LoggerLevel
import const
from commands import commands_bp
from error_handlers import error_handlers_bp
from objects.json_orm import Database, DatabaseError
fr... | true | true |
f741d96a7be5cad77ac86ffe06f37fceec063d14 | 7,616 | py | Python | tests/sensors/test_http_sensor.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 1 | 2019-10-10T23:53:01.000Z | 2019-10-10T23:53:01.000Z | tests/sensors/test_http_sensor.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 3 | 2020-07-07T20:39:24.000Z | 2021-09-29T17:34:46.000Z | tests/sensors/test_http_sensor.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 1 | 2020-11-04T03:17:51.000Z | 2020-11-04T03:17:51.000Z | # -*- coding: utf-8 -*-
#
# 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
#... | 34.152466 | 88 | 0.616859 |
import unittest
from unittest.mock import patch
import requests
from airflow import DAG
from airflow.exceptions import AirflowException, AirflowSensorTimeout
from airflow.models import TaskInstance
from airflow.operators.http_operator import SimpleHttpOperator
from airflow.sensors.http_sensor import... | true | true |
f741da02448185d0dcb3a5bea2ccec9378d49c58 | 37 | py | Python | tests/__init__.py | apiology/with_op | eb77469a296d2facf11a039fda3c25d0d2142a75 | [
"MIT"
] | 1 | 2019-07-24T19:35:19.000Z | 2019-07-24T19:35:19.000Z | tests/__init__.py | apiology/with_op | eb77469a296d2facf11a039fda3c25d0d2142a75 | [
"MIT"
] | 231 | 2018-09-12T17:09:46.000Z | 2021-07-11T20:07:05.000Z | tests/__init__.py | apiology/with_op | eb77469a296d2facf11a039fda3c25d0d2142a75 | [
"MIT"
] | null | null | null | """Unit test package for with_op."""
| 18.5 | 36 | 0.675676 | true | true | |
f741db445a2958d7c6be6d3a5527a6a927c81252 | 2,319 | py | Python | authlete/dto/backchannel_authentication_response.py | authlete/authlete-python | 751514c525cd04a930373de78463a1fe71b6da60 | [
"Apache-2.0"
] | 5 | 2019-07-30T01:37:04.000Z | 2021-02-15T05:55:55.000Z | authlete/dto/backchannel_authentication_response.py | DestinyCall/authlete-python | 751514c525cd04a930373de78463a1fe71b6da60 | [
"Apache-2.0"
] | null | null | null | authlete/dto/backchannel_authentication_response.py | DestinyCall/authlete-python | 751514c525cd04a930373de78463a1fe71b6da60 | [
"Apache-2.0"
] | 1 | 2021-02-15T05:55:56.000Z | 2021-02-15T05:55:56.000Z | #
# Copyright (C) 2019-2020 Authlete, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 43.754717 | 90 | 0.546787 |
from authlete.dto.api_response import ApiResponse
from authlete.dto.backchannel_authentication_action import BackchannelAuthenticationAction
from authlete.dto.scope import Scope
from authlete.types.delivery_mode import DeliveryMode
from... | true | true |
f741db61d92402460ecf689d551f9c1597c62595 | 36,309 | py | Python | var/spack/repos/builtin/packages/openfoam/package.py | alkino/spack | b87ff60c7e23d7b50fac620ad60c8e2537312ebd | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-06-25T15:25:29.000Z | 2020-06-25T15:25:29.000Z | var/spack/repos/builtin/packages/openfoam/package.py | alkino/spack | b87ff60c7e23d7b50fac620ad60c8e2537312ebd | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/openfoam/package.py | alkino/spack | b87ff60c7e23d7b50fac620ad60c8e2537312ebd | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-03-06T11:04:37.000Z | 2020-03-06T11:04:37.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
#
# Author: Mark Olesen <mark.olesen@esi-group.com>
#
# Legal Notice
# ------------
# OPENFOAM is a trademark owned by Ope... | 37.316547 | 116 | 0.578424 |
9249d6e0ef7eeb83db79a')
version('1612', sha256='2909c43506a68e1f23efd0ca6186a6948ae0fc8fe1e39c78cc23ef0d69f3569d')
variant('float32', default=False,
description='Use single-precision')
variant('int64', default=False,
description='With 64-bit labels')
variant('... | true | true |
f741dfcc57bb6469a81e9af8baa6223d4056edb9 | 816 | py | Python | employmonth.py | Enopoletus/enopoletus.github.io | 2701900dbc0f7f4dd1ec1c78d8be14095eafad28 | [
"MIT"
] | null | null | null | employmonth.py | Enopoletus/enopoletus.github.io | 2701900dbc0f7f4dd1ec1c78d8be14095eafad28 | [
"MIT"
] | 1 | 2019-06-18T06:42:36.000Z | 2019-06-18T06:42:36.000Z | employmonth.py | Enopoletus/enopoletus.github.io | 2701900dbc0f7f4dd1ec1c78d8be14095eafad28 | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib.pyplot as plt, mpld3
import numpy as np
import scipy.signal as sp
import matplotlib.ticker as plticker
df=pd.read_csv('numbers2.csv')
df.columns=['DATE', 'EMPLOYEES']
df.DATE=pd.to_datetime(df.DATE)
df.EMPLOYEES=np.log(df.EMPLOYEES)
trend=sp.savgol_filter(df.EMPLOYEES, 707, 4)
unsp... | 30.222222 | 45 | 0.718137 | import pandas as pd
import matplotlib.pyplot as plt, mpld3
import numpy as np
import scipy.signal as sp
import matplotlib.ticker as plticker
df=pd.read_csv('numbers2.csv')
df.columns=['DATE', 'EMPLOYEES']
df.DATE=pd.to_datetime(df.DATE)
df.EMPLOYEES=np.log(df.EMPLOYEES)
trend=sp.savgol_filter(df.EMPLOYEES, 707, 4)
unsp... | true | true |
f741e092eec04b7c5011c061a4f4ed69ddf40af0 | 661 | py | Python | 02_TensorFlow_Way/01_Operations_as_a_Computational_Graph/01_operations_on_a_graph.py | dolaameng/tensorflow_cookbook | ca9bcb892239e9276e9348689e06cd6d1edd19ef | [
"MIT"
] | null | null | null | 02_TensorFlow_Way/01_Operations_as_a_Computational_Graph/01_operations_on_a_graph.py | dolaameng/tensorflow_cookbook | ca9bcb892239e9276e9348689e06cd6d1edd19ef | [
"MIT"
] | null | null | null | 02_TensorFlow_Way/01_Operations_as_a_Computational_Graph/01_operations_on_a_graph.py | dolaameng/tensorflow_cookbook | ca9bcb892239e9276e9348689e06cd6d1edd19ef | [
"MIT"
] | 1 | 2018-04-25T17:10:22.000Z | 2018-04-25T17:10:22.000Z | # Operations on a Computational Graph
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from tensorflow.python.framework import ops
ops.reset_default_graph()
# Create graph
sess = tf.Session()
# Create tensors
# Create data to feed in
x_vals = np.array([1., 3., 5., 7., 9.])
x_data = tf.place... | 23.607143 | 67 | 0.738275 |
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from tensorflow.python.framework import ops
ops.reset_default_graph()
sess = tf.Session()
x_vals = np.array([1., 3., 5., 7., 9.])
x_data = tf.placeholder(tf.float32)
m = tf.constant(3.)
prod = tf.mul(x_data, m)
for x_val in x_vals:
... | true | true |
f741e134f19482f23b6c378b986dac2d4235f7f2 | 458 | py | Python | Old/Python-Advanced-Preliminary-Homeworks/Tuples and Sets/05. SoftUni Party.py | MNikov/Python-Advanced-September-2020 | 1d65039de7f094d908411afffa8aee9689ab4220 | [
"MIT"
] | 4 | 2020-09-19T13:53:19.000Z | 2020-11-01T18:34:53.000Z | Old/Python-Advanced-Preliminary-Homeworks/Tuples and Sets/05. SoftUni Party.py | MNikov/Python-Advanced-September-2020 | 1d65039de7f094d908411afffa8aee9689ab4220 | [
"MIT"
] | null | null | null | Old/Python-Advanced-Preliminary-Homeworks/Tuples and Sets/05. SoftUni Party.py | MNikov/Python-Advanced-September-2020 | 1d65039de7f094d908411afffa8aee9689ab4220 | [
"MIT"
] | null | null | null | def distribute_guests(n, end_command):
guests = set()
for _ in range(n):
guest = input()
guests.add(guest)
while True:
guest_arrived = input()
if guest_arrived == end_command:
break
guests.remove(guest_arrived)
return guests
def print_guests(guests):... | 21.809524 | 52 | 0.617904 | def distribute_guests(n, end_command):
guests = set()
for _ in range(n):
guest = input()
guests.add(guest)
while True:
guest_arrived = input()
if guest_arrived == end_command:
break
guests.remove(guest_arrived)
return guests
def print_guests(guests):... | true | true |
f741e13c2437cd9115f40fb949992ab73020898c | 251 | py | Python | agc/agc028/agc028a-2.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | 1 | 2019-08-21T00:49:34.000Z | 2019-08-21T00:49:34.000Z | agc/agc028/agc028a-2.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | agc/agc028/agc028a-2.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | from fractions import gcd
def lcm(x, y):
return x // gcd(x, y) * y
N, M = map(int, input().split())
S = input()
T = input()
for i in range(N):
if M * i % N == 0 and S[i] != T[M * i // N]:
print(-1)
exit()
print(lcm(N, M))
| 14.764706 | 48 | 0.478088 | from fractions import gcd
def lcm(x, y):
return x // gcd(x, y) * y
N, M = map(int, input().split())
S = input()
T = input()
for i in range(N):
if M * i % N == 0 and S[i] != T[M * i // N]:
print(-1)
exit()
print(lcm(N, M))
| true | true |
f741e18aaadaac4d8fa4c77e407b8fb59c8cfee4 | 124 | py | Python | 1026.py | gabriel1lima/Questoes---URI---Python | 4e88d76cf7ea68baf0464071bc4f72ced7d746cd | [
"MIT"
] | 1 | 2020-10-01T14:22:48.000Z | 2020-10-01T14:22:48.000Z | 1026.py | gabriel1lima/Questoes---URI---Python | 4e88d76cf7ea68baf0464071bc4f72ced7d746cd | [
"MIT"
] | null | null | null | 1026.py | gabriel1lima/Questoes---URI---Python | 4e88d76cf7ea68baf0464071bc4f72ced7d746cd | [
"MIT"
] | 7 | 2020-10-01T13:03:22.000Z | 2020-10-02T16:10:25.000Z | while(True):
try:
a, b = map(int, input().split())
print(a^b)
except EOFError:
break
| 8.857143 | 40 | 0.451613 | while(True):
try:
a, b = map(int, input().split())
print(a^b)
except EOFError:
break
| true | true |
f741e1bb088343149b3d64a6c5d6106be50977af | 2,355 | py | Python | core_engine/core_engine/controllers/aws/project_controller.py | Chronicles-of-AI/osiris | c71b1324ed270caa3724c0a8c58c4883b28dc19c | [
"Apache-2.0"
] | 3 | 2021-08-03T08:13:40.000Z | 2022-02-23T04:27:30.000Z | core_engine/core_engine/controllers/aws/project_controller.py | Chronicles-of-AI/osiris | c71b1324ed270caa3724c0a8c58c4883b28dc19c | [
"Apache-2.0"
] | null | null | null | core_engine/core_engine/controllers/aws/project_controller.py | Chronicles-of-AI/osiris | c71b1324ed270caa3724c0a8c58c4883b28dc19c | [
"Apache-2.0"
] | null | null | null | from core_engine.utils.aws.rekognition_helper import (
create_project,
delete_project,
version_description,
get_all_projects,
)
from core_engine import logger
logging = logger(__name__)
class ProjectController:
def __init__(self):
pass
def create_project_controller(self, project_name... | 25.879121 | 82 | 0.56518 | from core_engine.utils.aws.rekognition_helper import (
create_project,
delete_project,
version_description,
get_all_projects,
)
from core_engine import logger
logging = logger(__name__)
class ProjectController:
def __init__(self):
pass
def create_project_controller(self, project_name... | true | true |
f741e2d1a848fe5b03754acc4ab63a55a6566209 | 17,522 | py | Python | tests/components/group/test_media_player.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | tests/components/group/test_media_player.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | tests/components/group/test_media_player.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """The tests for the Media group platform."""
from unittest.mock import patch
import async_timeout
import pytest
from homeassistant.components.group import DOMAIN
from homeassistant.components.media_player import (
ATTR_MEDIA_CONTENT_TYPE,
ATTR_MEDIA_SEEK_POSITION,
ATTR_MEDIA_SHUFFLE,
ATTR_MEDIA_VOLUM... | 32.448148 | 88 | 0.666419 | from unittest.mock import patch
import async_timeout
import pytest
from homeassistant.components.group import DOMAIN
from homeassistant.components.media_player import (
ATTR_MEDIA_CONTENT_TYPE,
ATTR_MEDIA_SEEK_POSITION,
ATTR_MEDIA_SHUFFLE,
ATTR_MEDIA_VOLUME_LEVEL,
DOMAIN as MEDIA_DOMAIN,
SERVI... | true | true |
f741e3f38bf03dcbd364593bb25e49d1ddd3caf5 | 1,943 | py | Python | tests/test_gene_finder/test_utils.py | caacree/Opfi | 00650ff83e4fa5a4a782f6f7f48e744e36f45098 | [
"MIT"
] | 15 | 2021-08-18T18:11:39.000Z | 2022-03-30T05:34:03.000Z | tests/test_gene_finder/test_utils.py | caacree/Opfi | 00650ff83e4fa5a4a782f6f7f48e744e36f45098 | [
"MIT"
] | 14 | 2021-09-02T20:41:43.000Z | 2021-10-05T19:06:39.000Z | tests/test_gene_finder/test_utils.py | caacree/Opfi | 00650ff83e4fa5a4a782f6f7f48e744e36f45098 | [
"MIT"
] | 5 | 2021-07-08T18:16:03.000Z | 2022-03-04T17:04:52.000Z | import pytest
from gene_finder.utils import get_neighborhood_ranges
def _build_hit_dictionary(coords):
hits = {}
for coord in coords:
key = "hit_{}_{}".format(coord[0], coord[1])
hits[key] = {}
hits[key]["Query_start-pos"] = coord[0]
hits[key]["Query_end-pos"] = coord[1]
ret... | 42.23913 | 90 | 0.642306 | import pytest
from gene_finder.utils import get_neighborhood_ranges
def _build_hit_dictionary(coords):
hits = {}
for coord in coords:
key = "hit_{}_{}".format(coord[0], coord[1])
hits[key] = {}
hits[key]["Query_start-pos"] = coord[0]
hits[key]["Query_end-pos"] = coord[1]
ret... | true | true |
f741e5b644cf1a970fdff72b2837be233581e8b3 | 7,766 | py | Python | files/add_html_css_js.py | nogira/anki-minimal-theme | 1a1525795d5f94d2647d89a3eff5741a0ecefa4e | [
"MIT"
] | 4 | 2021-06-26T03:43:45.000Z | 2022-01-28T14:24:59.000Z | files/add_html_css_js.py | nogira/anki-minimal-theme | 1a1525795d5f94d2647d89a3eff5741a0ecefa4e | [
"MIT"
] | 13 | 2021-06-12T23:04:52.000Z | 2022-01-21T11:11:14.000Z | files/add_html_css_js.py | nogira/anki-minimal-theme | 1a1525795d5f94d2647d89a3eff5741a0ecefa4e | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
#
# MIT License
#
# Copyright (c) 2021 nogira
#
# 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 withou... | 64.716667 | 873 | 0.632501 |
from .common_imports import *
from aqt.webview import WebContent
from aqt.toolbar import TopToolbar, BottomToolbar
from aqt.deckbrowser import DeckBrowser
from aqt.reviewer import ReviewerBottomBar
from aqt.editor import Editor
from aqt.gui_hooks import webview_will_set_content
fro... | true | true |
f741e5bdaf6937b537b856c4dfefda2930324654 | 2,230 | py | Python | packit_service/service/app.py | jpopelka/packit-service | 5802fa78200daf9cd479d820c3cc003c530b9af7 | [
"MIT"
] | 20 | 2019-05-24T12:33:05.000Z | 2020-07-28T06:03:57.000Z | packit_service/service/app.py | jpopelka/packit-service | 5802fa78200daf9cd479d820c3cc003c530b9af7 | [
"MIT"
] | 735 | 2019-05-15T11:52:36.000Z | 2020-08-02T23:21:44.000Z | packit_service/service/app.py | jpopelka/packit-service | 5802fa78200daf9cd479d820c3cc003c530b9af7 | [
"MIT"
] | 28 | 2019-05-16T13:32:03.000Z | 2020-07-29T10:23:54.000Z | # Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
import logging
from os import getenv
from flask import Flask
from lazy_object_proxy import Proxy
from prometheus_client import make_wsgi_app as prometheus_app
from werkzeug.middleware.dispatcher import DispatcherMiddleware
from packit.uti... | 34.307692 | 94 | 0.741256 |
import logging
from os import getenv
from flask import Flask
from lazy_object_proxy import Proxy
from prometheus_client import make_wsgi_app as prometheus_app
from werkzeug.middleware.dispatcher import DispatcherMiddleware
from packit.utils import set_logging
from packit_service.config import ServiceConfig
from pa... | true | true |
f741e5c43928109c0d30c3d9ab13830a6be06246 | 33,258 | py | Python | tests/server/blueprints/institutes/test_institute_views.py | Clinical-Genomics/scout | 1ec4daa76093c2ffa4655612b63d325970253f58 | [
"BSD-3-Clause"
] | 111 | 2015-01-15T11:53:20.000Z | 2022-03-26T19:55:24.000Z | tests/server/blueprints/institutes/test_institute_views.py | Clinical-Genomics/scout | 1ec4daa76093c2ffa4655612b63d325970253f58 | [
"BSD-3-Clause"
] | 2,995 | 2015-01-15T16:14:20.000Z | 2022-03-31T13:36:32.000Z | tests/server/blueprints/institutes/test_institute_views.py | Clinical-Genomics/scout | 1ec4daa76093c2ffa4655612b63d325970253f58 | [
"BSD-3-Clause"
] | 55 | 2015-05-31T19:09:49.000Z | 2021-11-01T10:50:31.000Z | # -*- coding: utf-8 -*-
import datetime
import pytest
from flask import url_for
from flask_login import current_user
from scout.server.extensions import store
TEST_SUBPANEL = dict(
title="Subp title",
subtitle="Subp subtitle",
created=datetime.datetime.now(),
updated=datetime.datetime.now(),
)
def ... | 37.922463 | 137 | 0.642131 |
import datetime
import pytest
from flask import url_for
from flask_login import current_user
from scout.server.extensions import store
TEST_SUBPANEL = dict(
title="Subp title",
subtitle="Subp subtitle",
created=datetime.datetime.now(),
updated=datetime.datetime.now(),
)
def test_advanced_phenotype... | true | true |
f741e637368b51a200dc64bb5203e4b3ed2699f2 | 24,371 | py | Python | scicopia_tools/compile/ngrams.py | pikatech/Scicopia-tools | 0e19d694adeae862e3db92779d204e4944cc47bc | [
"MIT"
] | null | null | null | scicopia_tools/compile/ngrams.py | pikatech/Scicopia-tools | 0e19d694adeae862e3db92779d204e4944cc47bc | [
"MIT"
] | null | null | null | scicopia_tools/compile/ngrams.py | pikatech/Scicopia-tools | 0e19d694adeae862e3db92779d204e4944cc47bc | [
"MIT"
] | 1 | 2021-06-18T16:00:35.000Z | 2021-06-18T16:00:35.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 19 15:03:36 2021
@author: tech
"""
import argparse
import pickle
from collections import Counter
from itertools import tee
from typing import Any, Iterable, Iterator
import spacy
import zstandard as zstd
from spacy.matcher import Matcher
from tqdm ... | 31.899215 | 93 | 0.413606 |
import argparse
import pickle
from collections import Counter
from itertools import tee
from typing import Any, Iterable, Iterator
import spacy
import zstandard as zstd
from spacy.matcher import Matcher
from tqdm import tqdm
from scicopia_tools.db.arango import DbAccess, setup
from scicopia_tools.exceptions import ... | true | true |
f741e68e8b0b2542f16f1835e55ab8a08a0a4b08 | 3,164 | py | Python | tools/mo/openvino/tools/mo/front/tf/TFSliceToSlice.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 1 | 2019-09-22T01:05:07.000Z | 2019-09-22T01:05:07.000Z | tools/mo/openvino/tools/mo/front/tf/TFSliceToSlice.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 58 | 2020-11-06T12:13:45.000Z | 2022-03-28T13:20:11.000Z | tools/mo/openvino/tools/mo/front/tf/TFSliceToSlice.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 2 | 2021-07-14T07:40:50.000Z | 2021-07-27T01:40:03.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from openvino.tools.mo.ops.Cast import Cast
from openvino.tools.mo.ops.elementwise import Add, Equal
from openvino.tools.mo.ops.select import Select
from openvino.tools.mo.front.common.partial_infer.utils import int64... | 56.5 | 118 | 0.688685 |
import numpy as np
from openvino.tools.mo.ops.Cast import Cast
from openvino.tools.mo.ops.elementwise import Add, Equal
from openvino.tools.mo.ops.select import Select
from openvino.tools.mo.front.common.partial_infer.utils import int64_array
from openvino.tools.mo.front.common.replacement import FrontReplacementOp... | true | true |
f741e804a87707dfc2616db322002b170659667e | 18,351 | py | Python | archive/demos/afrl_helpers.py | glotzerlab/freud-examples | 589a66d7732ab1eeb097957938e766688c084ab1 | [
"BSD-3-Clause"
] | 11 | 2018-11-26T21:17:10.000Z | 2022-01-14T05:23:48.000Z | archive/demos/afrl_helpers.py | glotzerlab/freud-examples | 589a66d7732ab1eeb097957938e766688c084ab1 | [
"BSD-3-Clause"
] | 33 | 2019-03-11T03:09:47.000Z | 2022-02-02T17:16:48.000Z | archive/demos/afrl_helpers.py | glotzerlab/freud-examples | 589a66d7732ab1eeb097957938e766688c084ab1 | [
"BSD-3-Clause"
] | 6 | 2019-09-18T02:43:59.000Z | 2021-11-24T17:11:32.000Z | import matplotlib.colors as mplColors
import numpy as np
from bokeh.io import output_notebook
from bokeh.plotting import figure
from bokeh.resources import INLINE
from freud import box
from matplotlib import cm
output_notebook(resources=INLINE)
# define vertices for hexagons
verts = [
[0.537284965911771, 0.310201... | 33.733456 | 105 | 0.571413 | import matplotlib.colors as mplColors
import numpy as np
from bokeh.io import output_notebook
from bokeh.plotting import figure
from bokeh.resources import INLINE
from freud import box
from matplotlib import cm
output_notebook(resources=INLINE)
verts = [
[0.537284965911771, 0.31020161970069976],
[3.798874206... | true | true |
f741e926f1dd84a3a8aa4e96b5b7a9aad1ce7844 | 3,122 | py | Python | web/backend/django/django-girls/djangogirls/settings.py | morenice/til | 9b73f54045dbd65e08df4538300dd12a4a087540 | [
"Apache-2.0"
] | null | null | null | web/backend/django/django-girls/djangogirls/settings.py | morenice/til | 9b73f54045dbd65e08df4538300dd12a4a087540 | [
"Apache-2.0"
] | 13 | 2020-02-11T23:33:22.000Z | 2021-06-10T21:17:23.000Z | web/backend/django/django-girls/djangogirls/settings.py | morenice/til | 9b73f54045dbd65e08df4538300dd12a4a087540 | [
"Apache-2.0"
] | null | null | null | """
Django settings for djangogirls project.
Generated by 'django-admin startproject' using Django 2.1.4.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import o... | 25.590164 | 91 | 0.694747 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'u^-t63(6&t!)p%l1yv43t*+h0f1@h6b2c2kl&*38$#$kx%qy7$'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f741e931bf41d13fe3a346352e553d394f9230b8 | 42,232 | py | Python | lib/galaxy/web/framework/helpers/grids.py | cimtec/shu-fen | 0d3e41023c202f31b3e65cb3c75b34d399ae90ac | [
"CC-BY-3.0"
] | 1 | 2021-10-08T02:14:24.000Z | 2021-10-08T02:14:24.000Z | lib/galaxy/web/framework/helpers/grids.py | cimtec/shu-fen | 0d3e41023c202f31b3e65cb3c75b34d399ae90ac | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/web/framework/helpers/grids.py | cimtec/shu-fen | 0d3e41023c202f31b3e65cb3c75b34d399ae90ac | [
"CC-BY-3.0"
] | null | null | null | import logging
import math
from json import dumps, loads
from typing import Dict, List, Optional
from markupsafe import escape
from sqlalchemy.sql.expression import and_, false, func, null, or_, true
from galaxy.model.item_attrs import get_foreign_key, UsesAnnotations, UsesItemRatings
from galaxy.util import restore_... | 44.314795 | 207 | 0.600895 | import logging
import math
from json import dumps, loads
from typing import Dict, List, Optional
from markupsafe import escape
from sqlalchemy.sql.expression import and_, false, func, null, or_, true
from galaxy.model.item_attrs import get_foreign_key, UsesAnnotations, UsesItemRatings
from galaxy.util import restore_... | true | true |
f741e9df5c16784d1f1bea7240e6d9cb22d6059a | 2,287 | py | Python | cacahuate/grammar.py | categulario/cacahuate | 830b1656c8b5d183af637a47f9f3bcd04287f6b4 | [
"MIT"
] | null | null | null | cacahuate/grammar.py | categulario/cacahuate | 830b1656c8b5d183af637a47f9f3bcd04287f6b4 | [
"MIT"
] | null | null | null | cacahuate/grammar.py | categulario/cacahuate | 830b1656c8b5d183af637a47f9f3bcd04287f6b4 | [
"MIT"
] | null | null | null | from lark import Lark, Transformer
import operator
import os
class Condition:
def __init__(self):
filename = os.path.join(
os.path.dirname(__file__),
'grammars/condition.g'
)
with open(filename) as grammar_file:
self.parser = Lark(
gram... | 21.780952 | 61 | 0.580236 | from lark import Lark, Transformer
import operator
import os
class Condition:
def __init__(self):
filename = os.path.join(
os.path.dirname(__file__),
'grammars/condition.g'
)
with open(filename) as grammar_file:
self.parser = Lark(
gram... | true | true |
f741ebc3e6a63e2ceab74efa57e82c64a963f78e | 3,200 | py | Python | local_configs/11.10/psp_AT.py | wzpscott/SegformerDistillation | 6558757f5071251410e90270e197755860a6f41c | [
"DOC"
] | null | null | null | local_configs/11.10/psp_AT.py | wzpscott/SegformerDistillation | 6558757f5071251410e90270e197755860a6f41c | [
"DOC"
] | null | null | null | local_configs/11.10/psp_AT.py | wzpscott/SegformerDistillation | 6558757f5071251410e90270e197755860a6f41c | [
"DOC"
] | null | null | null | _base_ = [
'../_base_/datasets/ade20k_repeat.py',
'../_base_/default_runtime.py',
'../_base_/schedules/schedule_160k_adamw.py'
]
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='SDModule',
cfg_s=dict(
type='EncoderDecoder',
pretrained='pretrained/resnet50_v1c-... | 32.989691 | 95 | 0.535 | _base_ = [
'../_base_/datasets/ade20k_repeat.py',
'../_base_/default_runtime.py',
'../_base_/schedules/schedule_160k_adamw.py'
]
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='SDModule',
cfg_s=dict(
type='EncoderDecoder',
pretrained='pretrained/resnet50_v1c-... | true | true |
f741ebdd9015d835d260a60497f7a1184e190825 | 755 | py | Python | e_learning/interfaces.py | Mohamed-Kaizen/django_playground | 0ca623041857f15c06bd2f9c8edcd2b54b4c4897 | [
"MIT"
] | null | null | null | e_learning/interfaces.py | Mohamed-Kaizen/django_playground | 0ca623041857f15c06bd2f9c8edcd2b54b4c4897 | [
"MIT"
] | 3 | 2021-06-08T21:15:15.000Z | 2022-03-12T00:35:49.000Z | e_learning/interfaces.py | Mohamed-Kaizen/django_playground | 0ca623041857f15c06bd2f9c8edcd2b54b4c4897 | [
"MIT"
] | null | null | null | import uuid
from typing import Any, Dict
from loguru import logger
from analytics.signal import analytic_signal
from users.models import CustomUser
class UserInterface:
@staticmethod
def get_username(*, user_id: uuid.UUID) -> Dict[str, Any]:
return {"username": CustomUser.objects.get(user_uuid=user_... | 29.038462 | 79 | 0.724503 | import uuid
from typing import Any, Dict
from loguru import logger
from analytics.signal import analytic_signal
from users.models import CustomUser
class UserInterface:
@staticmethod
def get_username(*, user_id: uuid.UUID) -> Dict[str, Any]:
return {"username": CustomUser.objects.get(user_uuid=user_... | true | true |
f741ecd3efbc78b740158f12e7c8a4652a8fdd65 | 14,637 | py | Python | ceng113_hw5_260201003.py | umutcanceyhan7/python_survival_game | 43437c14be5e96817f96e4571000197acf5d90ac | [
"MIT"
] | null | null | null | ceng113_hw5_260201003.py | umutcanceyhan7/python_survival_game | 43437c14be5e96817f96e4571000197acf5d90ac | [
"MIT"
] | null | null | null | ceng113_hw5_260201003.py | umutcanceyhan7/python_survival_game | 43437c14be5e96817f96e4571000197acf5d90ac | [
"MIT"
] | null | null | null | # Umutcan CEYHAN 260201003
import numpy
class Game():
def __init__(self,map_width,map_height,init_time, action_cost):
# The Game initializes map parameters.
self.mapwidth = map_width
self.mapheight = map_height
# The Game initializes its map with all empty squares.
self.ma... | 41 | 124 | 0.530505 |
import numpy
class Game():
def __init__(self,map_width,map_height,init_time, action_cost):
self.mapwidth = map_width
self.mapheight = map_height
self.map = [['empty' for col in range(map_width)] for row in range(map_height)]
self.player = Player()
... | true | true |
f741ed811170add147f71df900fccc63ffe6dbb5 | 21,696 | py | Python | ingest/api/ingestapi.py | rdgoite/hca-ingest-client | af1bf24a900d50e74cc6d6d189c78b73ea890e7b | [
"Apache-2.0"
] | null | null | null | ingest/api/ingestapi.py | rdgoite/hca-ingest-client | af1bf24a900d50e74cc6d6d189c78b73ea890e7b | [
"Apache-2.0"
] | null | null | null | ingest/api/ingestapi.py | rdgoite/hca-ingest-client | af1bf24a900d50e74cc6d6d189c78b73ea890e7b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
desc goes here
"""
import json
import logging
import os
import time
import uuid
from urllib.parse import urljoin, quote
import requests
from requests import HTTPError
from ingest.api.requests_utils import optimistic_session
class IngestApi:
def __init__(self, url=None, ingest_api_root=... | 40.781955 | 170 | 0.622742 |
import json
import logging
import os
import time
import uuid
from urllib.parse import urljoin, quote
import requests
from requests import HTTPError
from ingest.api.requests_utils import optimistic_session
class IngestApi:
def __init__(self, url=None, ingest_api_root=None):
format = '[%(filename)s:%(lin... | true | true |
f741edca378cf7c4aaafba3e0fb35ea6b66263e8 | 1,816 | py | Python | source-py/pyBKT/util/metrics.py | shaoliangliang1996/pyBKT | 1354f95d7db6dd217c1a58cabc9c1352141ad4fd | [
"MIT"
] | 1 | 2021-07-13T02:10:34.000Z | 2021-07-13T02:10:34.000Z | source-py/pyBKT/util/metrics.py | shaoliangliang1996/pyBKT | 1354f95d7db6dd217c1a58cabc9c1352141ad4fd | [
"MIT"
] | null | null | null | source-py/pyBKT/util/metrics.py | shaoliangliang1996/pyBKT | 1354f95d7db6dd217c1a58cabc9c1352141ad4fd | [
"MIT"
] | null | null | null | import numpy as np
import sklearn.metrics as sk
SUPPORTED_METRICS = ['accuracy', 'auc', 'rmse']
def error_check(flat_true_values, pred_values):
if len(flat_true_values) != len(pred_values):
raise ValueError("preds and true values need to have same shape")
def accuracy(flat_true_values, pred_values):
... | 33.62963 | 113 | 0.636564 | import numpy as np
import sklearn.metrics as sk
SUPPORTED_METRICS = ['accuracy', 'auc', 'rmse']
def error_check(flat_true_values, pred_values):
if len(flat_true_values) != len(pred_values):
raise ValueError("preds and true values need to have same shape")
def accuracy(flat_true_values, pred_values):
... | true | true |
f741ee0b97711c6cd62b7158ed3522d8a16d3440 | 919 | py | Python | 168.py | whoophee/DCP | ea023dc7c01a13ee17f7e9445c7a70a092025254 | [
"MIT"
] | 2 | 2018-07-29T18:39:15.000Z | 2020-09-02T16:28:36.000Z | 168.py | whoophee/DCP | ea023dc7c01a13ee17f7e9445c7a70a092025254 | [
"MIT"
] | null | null | null | 168.py | whoophee/DCP | ea023dc7c01a13ee17f7e9445c7a70a092025254 | [
"MIT"
] | null | null | null | # This problem was asked by Facebook.
# Given an N by N matrix, rotate it by 90 degrees clockwise.
# For example, given the following matrix:
# [[1, 2, 3, 4],
# [5, 6, 7, 8],
# [9, 10, 11, 12],
# [13, 14, 15, 16]]
# you should return:
# Follow-up: What if you couldn't use any extra space?
####
def rotate90(arr):
... | 25.527778 | 115 | 0.513602 |
####
def rotate90(arr):
n = len(arr)
begin = 0
end = n-1
while begin < end:
for i in range(begin, end):
x0, y0 = begin, i
x1, y1 = i, end
x2, y2 = end, n-1 - i
x3, y3 = n-1-i, begin
arr[x0][y0], arr[x1][y1], arr[x2][y2], arr[x3... | true | true |
f741ee2006e596b59de936db950a0a44ef001ca5 | 10,643 | py | Python | mmdet/models/detectors/test_mixins.py | zhengye1995/Zero-shot-Instance-Segmentation | 6b25b318d7821b5f7a48f7d5e6dbd0bc63474e14 | [
"Apache-2.0"
] | 78 | 2021-04-15T03:00:51.000Z | 2022-03-30T03:29:06.000Z | mmdet/models/detectors/test_mixins.py | xthzhjwzyc/CVPR2021-paper-id-1395 | 5cd1414ee1e369bc6dac946086ceed17fe77b911 | [
"Apache-2.0"
] | 31 | 2021-04-21T13:54:20.000Z | 2022-01-26T13:56:44.000Z | mmdet/models/detectors/test_mixins.py | xthzhjwzyc/CVPR2021-paper-id-1395 | 5cd1414ee1e369bc6dac946086ceed17fe77b911 | [
"Apache-2.0"
] | 12 | 2021-04-15T03:00:53.000Z | 2022-02-14T04:39:41.000Z | from mmdet.core import (bbox2roi, bbox_mapping, merge_aug_bboxes,
merge_aug_masks, merge_aug_proposals, multiclass_nms)
class RPNTestMixin(object):
def simple_test_rpn(self, x, img_meta, rpn_test_cfg):
rpn_outs = self.rpn_head(x)
if len(rpn_outs) == 3: # bg_vector
... | 47.726457 | 114 | 0.513859 | from mmdet.core import (bbox2roi, bbox_mapping, merge_aug_bboxes,
merge_aug_masks, merge_aug_proposals, multiclass_nms)
class RPNTestMixin(object):
def simple_test_rpn(self, x, img_meta, rpn_test_cfg):
rpn_outs = self.rpn_head(x)
if len(rpn_outs) == 3:
bg_vect... | true | true |
f741ee27355375b4f1a039af046f2907dbae1ffb | 5,990 | py | Python | docker/utils/utils.py | sunset108/docker-py | 121ef395ce9659afccd49b1f2fbc456f1c854a90 | [
"Apache-2.0"
] | null | null | null | docker/utils/utils.py | sunset108/docker-py | 121ef395ce9659afccd49b1f2fbc456f1c854a90 | [
"Apache-2.0"
] | null | null | null | docker/utils/utils.py | sunset108/docker-py | 121ef395ce9659afccd49b1f2fbc456f1c854a90 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 dotCloud inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed t... | 27.860465 | 78 | 0.580134 |
import io
import tarfile
import tempfile
from distutils.version import StrictVersion
import requests
import six
from .. import errors
DEFAULT_HTTP_HOST = "127.0.0.1"
DEFAULT_UNIX_SOCKET = "http+unix://var/run/docker.sock"
def mkbuildcontext(dockerfile):
f = tempfile.NamedTemporaryFile()
t = t... | true | true |
f741f0483705c4b852615cc60573e3956fc231aa | 4,598 | py | Python | tests/unit/transports/event_transport_test.py | allan-simon/haigha | 7b004e1c0316ec14b94fec1c54554654c38b1a25 | [
"BSD-3-Clause"
] | 82 | 2015-03-26T03:57:14.000Z | 2020-05-08T12:35:44.000Z | tests/unit/transports/event_transport_test.py | allan-simon/haigha | 7b004e1c0316ec14b94fec1c54554654c38b1a25 | [
"BSD-3-Clause"
] | 32 | 2015-03-05T22:15:49.000Z | 2019-06-20T20:17:52.000Z | tests/unit/transports/event_transport_test.py | allan-simon/haigha | 7b004e1c0316ec14b94fec1c54554654c38b1a25 | [
"BSD-3-Clause"
] | 24 | 2015-03-23T15:47:35.000Z | 2020-05-08T12:35:45.000Z | '''
Copyright (c) 2011-2017, Agora Games, LLC All rights reserved.
https://github.com/agoragames/haigha/blob/master/LICENSE.txt
'''
from chai import Chai
from haigha.transports import event_transport
from haigha.transports.event_transport import *
class EventTransportTest(Chai):
def setUp(self):
super... | 35.921875 | 83 | 0.670291 |
from chai import Chai
from haigha.transports import event_transport
from haigha.transports.event_transport import *
class EventTransportTest(Chai):
def setUp(self):
super(EventTransportTest, self).setUp()
self.connection = mock()
self.transport = EventTransport(self.connection)
... | true | true |
f741f0d019b5bee234279b686239bab118c8008a | 14,423 | py | Python | AutomatedTesting/Gem/PythonTests/physics/C12712454_ScriptCanvas_OverlapNodeVerification.py | cypherdotXd/o3de | bb90c4ddfe2d495e9c00ebf1e2650c6d603a5676 | [
"Apache-2.0",
"MIT"
] | 1 | 2022-03-12T14:13:45.000Z | 2022-03-12T14:13:45.000Z | AutomatedTesting/Gem/PythonTests/physics/C12712454_ScriptCanvas_OverlapNodeVerification.py | cypherdotXd/o3de | bb90c4ddfe2d495e9c00ebf1e2650c6d603a5676 | [
"Apache-2.0",
"MIT"
] | 2 | 2022-01-13T04:29:38.000Z | 2022-03-12T01:05:31.000Z | AutomatedTesting/Gem/PythonTests/physics/C12712454_ScriptCanvas_OverlapNodeVerification.py | cypherdotXd/o3de | bb90c4ddfe2d495e9c00ebf1e2650c6d603a5676 | [
"Apache-2.0",
"MIT"
] | null | null | null | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
# Test case ID : 12712454
# Test Case Title : Verify overlap nodes in script canvas
# fmt: off
class Tests:
... | 43.972561 | 125 | 0.657353 |
class Tests:
enter_game_mode = ("Entered game mode", "Failed to enter game mode")
exit_game_mode = ("Exited game mode", "Couldn't exit game mode")
# comm entities are used for communication between script canvas and the python script.
comm_entiti... | true | true |
f741f16fcd4b6ff4539f17ccd45bdb75bedb1a6b | 1,068 | py | Python | qmldataset/configurations/default_config_names.py | rajibchakravorty/QDataSet | 8eb21b8c7dad5654358021dd73b93ab90443f6d0 | [
"MIT"
] | null | null | null | qmldataset/configurations/default_config_names.py | rajibchakravorty/QDataSet | 8eb21b8c7dad5654358021dd73b93ab90443f6d0 | [
"MIT"
] | null | null | null | qmldataset/configurations/default_config_names.py | rajibchakravorty/QDataSet | 8eb21b8c7dad5654358021dd73b93ab90443f6d0 | [
"MIT"
] | null | null | null | """Dictionary of default configuration names
"""
from . import config_1q_X
from . import config_1q_X_N1Z
from . import config_1q_X_N2Z
from . import config_1q_X_N3Z
from . import config_1q_X_N4Z
from . import config_1q_XY
from . import config_1q_XY_N1X_N5Z
from . import config_1q_XY_N1X_N6Z
from . import config_1q_XY_... | 32.363636 | 66 | 0.798689 |
from . import config_1q_X
from . import config_1q_X_N1Z
from . import config_1q_X_N2Z
from . import config_1q_X_N3Z
from . import config_1q_X_N4Z
from . import config_1q_XY
from . import config_1q_XY_N1X_N5Z
from . import config_1q_XY_N1X_N6Z
from . import config_1q_XY_N3X_N6Z
from . import config_2q_IX_XI_XX
from . i... | true | true |
f741f2216e1a6ac456655c660a8ea0b689e44936 | 908 | py | Python | services/ingest-file/ingestors/worker.py | adikadashrieq/aleph | acc03197c10e511a279ae3a05120187223f173d2 | [
"MIT"
] | 2 | 2020-02-01T00:53:53.000Z | 2021-10-10T04:18:20.000Z | services/ingest-file/ingestors/worker.py | adikadashrieq/aleph | acc03197c10e511a279ae3a05120187223f173d2 | [
"MIT"
] | null | null | null | services/ingest-file/ingestors/worker.py | adikadashrieq/aleph | acc03197c10e511a279ae3a05120187223f173d2 | [
"MIT"
] | null | null | null | import logging
from followthemoney import model
from servicelayer.worker import Worker
from ingestors.manager import Manager
log = logging.getLogger(__name__)
class IngestWorker(Worker):
"""A long running task runner that uses Redis as a task queue"""
def dispatch_next(self, task, entities):
next_s... | 31.310345 | 73 | 0.672907 | import logging
from followthemoney import model
from servicelayer.worker import Worker
from ingestors.manager import Manager
log = logging.getLogger(__name__)
class IngestWorker(Worker):
def dispatch_next(self, task, entities):
next_stage = task.context.get('next_stage')
if next_stage is None:
... | true | true |
f741f28e3b4ef5b851bc3a425ac74e4b1b217d29 | 4,875 | py | Python | plaso/parsers/winreg_plugins/usbstor.py | SamuelePilleri/plaso | f5687f12a89c7309797ccc285da78e855c120579 | [
"Apache-2.0"
] | null | null | null | plaso/parsers/winreg_plugins/usbstor.py | SamuelePilleri/plaso | f5687f12a89c7309797ccc285da78e855c120579 | [
"Apache-2.0"
] | null | null | null | plaso/parsers/winreg_plugins/usbstor.py | SamuelePilleri/plaso | f5687f12a89c7309797ccc285da78e855c120579 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""File containing a Windows Registry plugin to parse the USBStor key."""
from __future__ import unicode_literals
from plaso.containers import time_events
from plaso.containers import windows_events
from plaso.lib import definitions
from plaso.parsers import logger
from plaso.parsers import wi... | 39.634146 | 79 | 0.71159 |
from __future__ import unicode_literals
from plaso.containers import time_events
from plaso.containers import windows_events
from plaso.lib import definitions
from plaso.parsers import logger
from plaso.parsers import winreg
from plaso.parsers.winreg_plugins import interface
class USBStorPlugin(interface.WindowsRe... | true | true |
f741f2b2445d7fcb9539f67dac5907fab7893a01 | 4,469 | py | Python | conditional_batchnorm.py | tasbolat1/DGflow | 6ce22095a0d33f4da3c15f093aa365ba6cabbac9 | [
"MIT"
] | 15 | 2021-02-03T13:34:03.000Z | 2022-02-16T03:33:23.000Z | conditional_batchnorm.py | tasbolat1/DGflow | 6ce22095a0d33f4da3c15f093aa365ba6cabbac9 | [
"MIT"
] | null | null | null | conditional_batchnorm.py | tasbolat1/DGflow | 6ce22095a0d33f4da3c15f093aa365ba6cabbac9 | [
"MIT"
] | 4 | 2021-05-13T05:31:19.000Z | 2022-02-16T06:57:16.000Z | import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init
class ConditionalBatchNorm2d(nn.BatchNorm2d):
"""Conditional Batch Normalization"""
def __init__(self, num_features, eps=1e-05, momentum=0.1,
affine=False, track_running_stats=True):
super(ConditionalBat... | 33.856061 | 76 | 0.623406 | import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init
class ConditionalBatchNorm2d(nn.BatchNorm2d):
def __init__(self, num_features, eps=1e-05, momentum=0.1,
affine=False, track_running_stats=True):
super(ConditionalBatchNorm2d, self).__init__(
num_... | true | true |
f741f47021d1439ce989ce8cd366e2ed7c11cc45 | 8,154 | py | Python | tests/ut/python/privacy/diff_privacy/test_monitor.py | hboshnak/mindarmour | 0609a4eaea875a84667bed279add9305752880cc | [
"Apache-2.0"
] | 139 | 2020-03-28T02:37:07.000Z | 2022-03-24T15:35:39.000Z | tests/ut/python/privacy/diff_privacy/test_monitor.py | hboshnak/mindarmour | 0609a4eaea875a84667bed279add9305752880cc | [
"Apache-2.0"
] | 2 | 2020-04-02T09:50:21.000Z | 2020-05-09T06:52:57.000Z | tests/ut/python/privacy/diff_privacy/test_monitor.py | hboshnak/mindarmour | 0609a4eaea875a84667bed279add9305752880cc | [
"Apache-2.0"
] | 12 | 2020-03-28T02:52:42.000Z | 2021-07-15T08:05:06.000Z | # Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 39.201923 | 78 | 0.641894 |
import pytest
import numpy as np
import mindspore.nn as nn
import mindspore.dataset as ds
from mindspore.train import Model
import mindspore.context as context
from mindarmour.privacy.diff_privacy import PrivacyMonitorFactory
from mindarmour.utils.logger import LogUtil
from tests.ut.python.utils.mock_ne... | true | true |
f741f4da27d6d75ec64b5ca171f1410d843eb1c6 | 5,498 | py | Python | sgkit/model.py | timothymillar/sgkit | a3a5e961b6b21ff7de235075955c0f797ad5027c | [
"Apache-2.0"
] | null | null | null | sgkit/model.py | timothymillar/sgkit | a3a5e961b6b21ff7de235075955c0f797ad5027c | [
"Apache-2.0"
] | 2 | 2021-05-16T16:09:22.000Z | 2021-06-15T21:03:56.000Z | sgkit/model.py | timothymillar/sgkit | a3a5e961b6b21ff7de235075955c0f797ad5027c | [
"Apache-2.0"
] | 1 | 2021-05-15T05:01:41.000Z | 2021-05-15T05:01:41.000Z | from typing import Any, Dict, Hashable, List, Optional
import numpy as np
import xarray as xr
from .typing import ArrayLike
from .utils import create_dataset
DIM_VARIANT = "variants"
DIM_SAMPLE = "samples"
DIM_PLOIDY = "ploidy"
DIM_ALLELE = "alleles"
DIM_GENOTYPE = "genotypes"
def create_genotype_call_dataset(
... | 34.149068 | 91 | 0.655875 | from typing import Any, Dict, Hashable, List, Optional
import numpy as np
import xarray as xr
from .typing import ArrayLike
from .utils import create_dataset
DIM_VARIANT = "variants"
DIM_SAMPLE = "samples"
DIM_PLOIDY = "ploidy"
DIM_ALLELE = "alleles"
DIM_GENOTYPE = "genotypes"
def create_genotype_call_dataset(
... | true | true |
f741f6d898ce96f476634486d4ba2e6726e7d7f1 | 202 | py | Python | exercises/exe11 - 20/exe018.py | thomas-rohde/Classes-Python | f862995510b7aabf68bc14aecf815f597034d8a1 | [
"MIT"
] | null | null | null | exercises/exe11 - 20/exe018.py | thomas-rohde/Classes-Python | f862995510b7aabf68bc14aecf815f597034d8a1 | [
"MIT"
] | null | null | null | exercises/exe11 - 20/exe018.py | thomas-rohde/Classes-Python | f862995510b7aabf68bc14aecf815f597034d8a1 | [
"MIT"
] | null | null | null | from random import shuffle
n0 = input('1ª Aluna: ')
n1 = input('2ª Aluna: ')
n2 = input('3ª Aluna: ')
n3 = input('4ª Aluna: ')
l = [n0, n1, n2, n3]
shuffle(l)
print('A ordem dos alunos é {}'.format(l)) | 22.444444 | 42 | 0.613861 | from random import shuffle
n0 = input('1ª Aluna: ')
n1 = input('2ª Aluna: ')
n2 = input('3ª Aluna: ')
n3 = input('4ª Aluna: ')
l = [n0, n1, n2, n3]
shuffle(l)
print('A ordem dos alunos é {}'.format(l)) | true | true |
f741f75312b240700c8e6953eef7f268cdf1d5f1 | 1,092 | py | Python | setup.py | SimonBiggs/pytest-pylint | 3e0bbfae6e0c62f8755336e745aecf23907eee30 | [
"MIT"
] | null | null | null | setup.py | SimonBiggs/pytest-pylint | 3e0bbfae6e0c62f8755336e745aecf23907eee30 | [
"MIT"
] | null | null | null | setup.py | SimonBiggs/pytest-pylint | 3e0bbfae6e0c62f8755336e745aecf23907eee30 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pytest-pylint
=============
Plugin for py.test for doing pylint tests
"""
from setuptools import setup
setup(
name='pytest-pylint',
description='pytest plugin to check source code with pylint',
long_description=open("README.rst").read(),
license='MIT',
version='0.18.0'... | 30.333333 | 69 | 0.6163 |
from setuptools import setup
setup(
name='pytest-pylint',
description='pytest plugin to check source code with pylint',
long_description=open("README.rst").read(),
license='MIT',
version='0.18.0',
author='Carson Gee',
author_email='x@carsongee.com',
url='https://github.com/carsongee/p... | true | true |
f741f878ba7b29881c62ce244081400c4214c0c9 | 6,345 | py | Python | options/train_options.py | snakch/pixel2style2pixel | 63e9c397daf7d4e81dc963a14231990b510ec1a8 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT"
] | null | null | null | options/train_options.py | snakch/pixel2style2pixel | 63e9c397daf7d4e81dc963a14231990b510ec1a8 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT"
] | null | null | null | options/train_options.py | snakch/pixel2style2pixel | 63e9c397daf7d4e81dc963a14231990b510ec1a8 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT"
] | null | null | null | from argparse import ArgumentParser
from configs.paths_config import model_paths
from dataclasses import dataclass
@dataclass
class TrainOptionsDataClass:
exp_dir: str
dataset_type: str = "ffhq_encode"
encoder_type: str = "GradualStyleEncoder"
input_nc: int = 3
label_nc: int = 0
batch_size: ... | 27.828947 | 88 | 0.534121 | from argparse import ArgumentParser
from configs.paths_config import model_paths
from dataclasses import dataclass
@dataclass
class TrainOptionsDataClass:
exp_dir: str
dataset_type: str = "ffhq_encode"
encoder_type: str = "GradualStyleEncoder"
input_nc: int = 3
label_nc: int = 0
batch_size: ... | true | true |
f741f8f449b5fd7a651b9eda849d2a149c197fb7 | 10,902 | py | Python | pelix/remote/transport/jabsorb_rpc.py | svidoso/ipopo | 1d4b81207e67890dfccc8f562336c7104f194c17 | [
"Apache-2.0"
] | 65 | 2015-04-21T10:41:18.000Z | 2022-01-02T16:25:40.000Z | pelix/remote/transport/jabsorb_rpc.py | svidoso/ipopo | 1d4b81207e67890dfccc8f562336c7104f194c17 | [
"Apache-2.0"
] | 85 | 2015-01-20T14:23:52.000Z | 2022-02-19T17:08:46.000Z | pelix/remote/transport/jabsorb_rpc.py | svidoso/ipopo | 1d4b81207e67890dfccc8f562336c7104f194c17 | [
"Apache-2.0"
] | 32 | 2015-03-13T07:43:05.000Z | 2020-04-24T07:56:53.000Z | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Pelix Remote Services: Java-compatible RPC, based on the Jabsorb library
:author: Thomas Calmant
:copyright: Copyright 2020, Thomas Calmant
:license: Apache License 2.0
:version: 1.0.1
..
Copyright 2020 Thomas Calmant
Licensed under the Apache Licens... | 28.917772 | 80 | 0.601724 |
import logging
from jsonrpclib.SimpleJSONRPCServer import (
SimpleJSONRPCDispatcher,
NoMulticallResult,
)
import jsonrpclib.jsonrpc as jsonrpclib
import pelix.misc.jabsorb as jabsorb
from pelix.ipopo.decorators import (
ComponentFactory,
Provides,
Validate,
Invalidate,
Requires,
... | true | true |
f741f90ccd0c3c53faa7f853a6af6c9ff13a28c4 | 5,504 | py | Python | nipy/io/tests/test_save.py | fperez/nipy | 559f17150bd9fa8ead4fd088b330d7cf7db7aa79 | [
"BSD-3-Clause"
] | 1 | 2015-05-07T16:53:33.000Z | 2015-05-07T16:53:33.000Z | nipy/io/tests/test_save.py | fperez/nipy | 559f17150bd9fa8ead4fd088b330d7cf7db7aa79 | [
"BSD-3-Clause"
] | null | null | null | nipy/io/tests/test_save.py | fperez/nipy | 559f17150bd9fa8ead4fd088b330d7cf7db7aa79 | [
"BSD-3-Clause"
] | null | null | null | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
from tempfile import mkstemp
import numpy as np
from nipy.testing import assert_true, assert_false, assert_equal, \
assert_array_almost_equal, funcfile
from nipy.io.api import load_image, s... | 34.4 | 81 | 0.647892 |
import os
from tempfile import mkstemp
import numpy as np
from nipy.testing import assert_true, assert_false, assert_equal, \
assert_array_almost_equal, funcfile
from nipy.io.api import load_image, save_image
from nipy.core import api
class Tempfile():
file = None
tmpfile = Tempfile()
def setup():
f... | true | true |
f741f933b7c32df127e1e34c19e9249b48bd1f16 | 3,872 | py | Python | makewiki/settings.py | Rasenku/makewiki_v2 | 4a61c64824f26d5f595c57c240a1a5190991ad51 | [
"MIT"
] | null | null | null | makewiki/settings.py | Rasenku/makewiki_v2 | 4a61c64824f26d5f595c57c240a1a5190991ad51 | [
"MIT"
] | 6 | 2020-06-06T01:25:11.000Z | 2022-02-10T13:48:49.000Z | makewiki/settings.py | clenberger/makewiki-v2 | 3dffafb708e206bf93bcc5b9aa7881bbeae34bf9 | [
"MIT"
] | null | null | null | """
Django settings for makewiki project.
Generated by 'django-admin startproject' using Django 2.2.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
... | 25.986577 | 96 | 0.694473 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '1yct-t!2bnkgc7j59z+9cdd2k)@y+ftqor$!aya()3if^cnlo-'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f741f99fe4171390615ec825282a6401d178df1f | 6,131 | py | Python | congress/datasources/datasource_driver.py | aaronorosen/congress | 2f74410c93a4d761a6fb3d913ea6bec87fd3085c | [
"Apache-2.0"
] | 1 | 2016-02-10T00:59:31.000Z | 2016-02-10T00:59:31.000Z | congress/datasources/datasource_driver.py | aaronorosen/congress | 2f74410c93a4d761a6fb3d913ea6bec87fd3085c | [
"Apache-2.0"
] | null | null | null | congress/datasources/datasource_driver.py | aaronorosen/congress | 2f74410c93a4d761a6fb3d913ea6bec87fd3085c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2013 VMware, 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
#
... | 40.335526 | 79 | 0.596966 |
from congress.dse import deepsix
from congress.policy import compile
from congress.policy import runtime
class DataSourceDriver(deepsix.deepSix):
def __init__(self, name, keys, inbox=None, datapath=None,
poll_time=None, **creds):
if poll_time is None:
poll_time... | true | true |
f741f9a134a29cde4417d89a622f8515e0c9db99 | 2,842 | py | Python | actions.py | ratnasankeerthanreddy/Chatbot-for-Personal-assisatance | 6c584601af4c98a3bebedf7073e0ccf2ad8ecf76 | [
"MIT"
] | 1 | 2020-10-28T15:57:44.000Z | 2020-10-28T15:57:44.000Z | actions.py | ratnasankeerthanreddy/Chatbot-for-Personal-assisatance | 6c584601af4c98a3bebedf7073e0ccf2ad8ecf76 | [
"MIT"
] | null | null | null | actions.py | ratnasankeerthanreddy/Chatbot-for-Personal-assisatance | 6c584601af4c98a3bebedf7073e0ccf2ad8ecf76 | [
"MIT"
] | null | null | null | from typing import Any, Text, Dict, List
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
from utils import convert_timestamp
from rasa_sdk.events import AllSlotsReset
import datetime
from datetime import timedelta, date
import dateutil.parser
import boto3
from boto3.dynamodb.cond... | 35.974684 | 363 | 0.678044 | from typing import Any, Text, Dict, List
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
from utils import convert_timestamp
from rasa_sdk.events import AllSlotsReset
import datetime
from datetime import timedelta, date
import dateutil.parser
import boto3
from boto3.dynamodb.cond... | true | true |
f741fa7d58a67afe45aa04452ed154c7616067c2 | 62 | py | Python | pydlm/plot/__init__.py | dtolpin/pydlm | 0016876bf6357784b161ecaa4f0798c063c54785 | [
"BSD-3-Clause"
] | 423 | 2016-09-15T06:45:26.000Z | 2022-03-29T08:41:11.000Z | pydlm/plot/__init__.py | dtolpin/pydlm | 0016876bf6357784b161ecaa4f0798c063c54785 | [
"BSD-3-Clause"
] | 50 | 2016-09-14T19:45:49.000Z | 2021-07-26T17:04:10.000Z | pydlm/plot/__init__.py | dtolpin/pydlm | 0016876bf6357784b161ecaa4f0798c063c54785 | [
"BSD-3-Clause"
] | 99 | 2016-09-19T08:08:41.000Z | 2022-03-07T13:47:36.000Z | #__all__ = ['dlmPlot']
#import pydlm.plot.dlmPlot as dlmPlot
| 15.5 | 37 | 0.725806 | true | true | |
f741fcb9270622ed9b472a24bccf703c5ec28a4c | 3,428 | py | Python | openbb_terminal/cryptocurrency/defi/smartstake_view.py | tehcoderer/GamestonkTerminal | 54a1b6f545a0016c576e9e00eef5c003d229dacf | [
"MIT"
] | null | null | null | openbb_terminal/cryptocurrency/defi/smartstake_view.py | tehcoderer/GamestonkTerminal | 54a1b6f545a0016c576e9e00eef5c003d229dacf | [
"MIT"
] | null | null | null | openbb_terminal/cryptocurrency/defi/smartstake_view.py | tehcoderer/GamestonkTerminal | 54a1b6f545a0016c576e9e00eef5c003d229dacf | [
"MIT"
] | null | null | null | """SentimentInvestor View"""
__docformat__ = "numpy"
import os
import logging
from typing import Optional, List
from matplotlib import pyplot as plt
from openbb_terminal.decorators import check_api_key
from openbb_terminal.cryptocurrency.defi import smartstake_model
from openbb_terminal.helper_funcs import (
exp... | 25.021898 | 84 | 0.636523 | __docformat__ = "numpy"
import os
import logging
from typing import Optional, List
from matplotlib import pyplot as plt
from openbb_terminal.decorators import check_api_key
from openbb_terminal.cryptocurrency.defi import smartstake_model
from openbb_terminal.helper_funcs import (
export_data,
plot_autoscale,... | true | true |
f741fcc5b078acea4fa5592a85dfa586ca84fade | 52 | py | Python | hardware/BME280/__init__.py | RechnioMateusz/weather_forecast | 5ae9c65336831042b74a77e05c163b7b65b90dcd | [
"MIT"
] | 1 | 2019-10-22T20:09:54.000Z | 2019-10-22T20:09:54.000Z | hardware/BME280/__init__.py | RechnioMateusz/weather_forecast | 5ae9c65336831042b74a77e05c163b7b65b90dcd | [
"MIT"
] | null | null | null | hardware/BME280/__init__.py | RechnioMateusz/weather_forecast | 5ae9c65336831042b74a77e05c163b7b65b90dcd | [
"MIT"
] | null | null | null | from .bme280_handler import BME280, BME280Exception
| 26 | 51 | 0.865385 | from .bme280_handler import BME280, BME280Exception
| true | true |
f741fe8e57074ae189bab276e1b0899135878334 | 595 | py | Python | pynsgp/Selection/Selection.py | marcovirgolin/pyNSGP | 4a9634161012d6ab39ce3d304dba943b6f7d9b29 | [
"MIT"
] | 19 | 2020-05-26T05:48:51.000Z | 2022-01-01T13:32:34.000Z | pynsgp/Selection/Selection.py | marcovirgolin/pyNSGP | 4a9634161012d6ab39ce3d304dba943b6f7d9b29 | [
"MIT"
] | 1 | 2021-12-06T06:41:31.000Z | 2021-12-06T16:19:46.000Z | pynsgp/Selection/Selection.py | marcovirgolin/pyNSGP | 4a9634161012d6ab39ce3d304dba943b6f7d9b29 | [
"MIT"
] | 3 | 2021-01-18T13:37:42.000Z | 2021-09-26T08:19:15.000Z | import numpy as np
from copy import deepcopy
from numpy.random import randint
def TournamentSelect( population, how_many_to_select, tournament_size=4 ):
pop_size = len(population)
selection = []
while len(selection) < how_many_to_select:
best = population[randint(pop_size)]
for i in range(tournament_size - 1)... | 29.75 | 128 | 0.764706 | import numpy as np
from copy import deepcopy
from numpy.random import randint
def TournamentSelect( population, how_many_to_select, tournament_size=4 ):
pop_size = len(population)
selection = []
while len(selection) < how_many_to_select:
best = population[randint(pop_size)]
for i in range(tournament_size - 1)... | true | true |
f741fe92784d071e7aaeb9223f6d21bca2014920 | 1,265 | py | Python | camera_plugins/scripts/camera_plugins_node.py | liangzhao123/topic_ws | ef7aba11b975eab5f657101ed696b49ec94b5f86 | [
"Apache-2.0"
] | null | null | null | camera_plugins/scripts/camera_plugins_node.py | liangzhao123/topic_ws | ef7aba11b975eab5f657101ed696b49ec94b5f86 | [
"Apache-2.0"
] | null | null | null | camera_plugins/scripts/camera_plugins_node.py | liangzhao123/topic_ws | ef7aba11b975eab5f657101ed696b49ec94b5f86 | [
"Apache-2.0"
] | 1 | 2021-03-27T09:54:49.000Z | 2021-03-27T09:54:49.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
import ros_numpy
import cv2
class image_listenner:
def __init__(self):
self.bridge = CvBridge()
self.image_sub = ros... | 29.418605 | 103 | 0.666403 |
from __future__ import print_function
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
import ros_numpy
import cv2
class image_listenner:
def __init__(self):
self.bridge = CvBridge()
self.image_sub = rospy.Subscriber("/pylon_camera_node/image_raw"... | true | true |
f741fedf5017ea3ed61b5b1b6ec17664102991d5 | 1,760 | py | Python | sktime/classification/feature_based/tests/test_fresh_prince.py | Aparna-Sakshi/sktime | 419d347f062320290fb65e4afec72b82179e63bf | [
"BSD-3-Clause"
] | 1 | 2021-09-08T14:24:52.000Z | 2021-09-08T14:24:52.000Z | sktime/classification/feature_based/tests/test_fresh_prince.py | Aparna-Sakshi/sktime | 419d347f062320290fb65e4afec72b82179e63bf | [
"BSD-3-Clause"
] | null | null | null | sktime/classification/feature_based/tests/test_fresh_prince.py | Aparna-Sakshi/sktime | 419d347f062320290fb65e4afec72b82179e63bf | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""FreshPRINCE test code."""
import numpy as np
from numpy import testing
from sklearn.metrics import accuracy_score
from sktime.classification.feature_based import FreshPRINCE
from sktime.datasets import load_unit_test
def test_fresh_prince_on_unit_test_data():
"""Test of FreshPRINCE on ... | 21.728395 | 88 | 0.521023 |
import numpy as np
from numpy import testing
from sklearn.metrics import accuracy_score
from sktime.classification.feature_based import FreshPRINCE
from sktime.datasets import load_unit_test
def test_fresh_prince_on_unit_test_data():
X_train, y_train = load_unit_test(split="train")
X_test, y_test = loa... | true | true |
f742009710867138d6efdc26c0460c5522f38e3d | 6,107 | py | Python | EIDEGraphics/EIDEChannelsManager.py | Vicente-Francisco/EIDEGraphics | 8e61bf64f4644a2e80df00946271f8cba4b5e65e | [
"Unlicense"
] | 2 | 2022-02-09T08:06:13.000Z | 2022-03-18T07:30:19.000Z | EIDEGraphics/EIDEChannelsManager.py | Vicente-Francisco/EIDEGraphics | 8e61bf64f4644a2e80df00946271f8cba4b5e65e | [
"Unlicense"
] | null | null | null | EIDEGraphics/EIDEChannelsManager.py | Vicente-Francisco/EIDEGraphics | 8e61bf64f4644a2e80df00946271f8cba4b5e65e | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
#############################################################################
# #
# EIDEChannesManager #
# ... | 31.642487 | 79 | 0.502374 | true | true | |
f742011c788550ea25a25318b5b9b72e890832df | 24,459 | py | Python | pysnmp/CISCO-ENTITY-EXT-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/CISCO-ENTITY-EXT-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/CISCO-ENTITY-EXT-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CISCO-ENTITY-EXT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-ENTITY-EXT-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:39:41 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (defau... | 132.210811 | 3,507 | 0.766507 |
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuild... | true | true |
f74201a94d7a358f63b2df1b4eea26ca14b09d78 | 444 | py | Python | monitoring/admin.py | TyBeeProject/TyBeeWeb | d4d850000a95866272c4ba3e998f753e0cf8a6a3 | [
"MIT"
] | 2 | 2016-10-31T10:17:45.000Z | 2017-04-03T09:30:07.000Z | monitoring/admin.py | TyBeeProject/TyBeeWeb | d4d850000a95866272c4ba3e998f753e0cf8a6a3 | [
"MIT"
] | null | null | null | monitoring/admin.py | TyBeeProject/TyBeeWeb | d4d850000a95866272c4ba3e998f753e0cf8a6a3 | [
"MIT"
] | null | null | null | # coding: utf-8
from django.contrib import admin
from .models import Hive, Captor, Data
# Possibilité ajout capteur :
# ajoute dans la bdd une table pour le nouveau capteur, ainsi que l'identifiant qui devra être utilisé pour parser le flux de la ruche
#
admin.site.register(Hive)
admin.site.register(Captor)
admin.si... | 34.153846 | 137 | 0.77027 |
from django.contrib import admin
from .models import Hive, Captor, Data
#
admin.site.register(Hive)
admin.site.register(Captor)
admin.site.register(Data)
# Possibilité ajout ruche :
# ajoute une adresse ip/ un port pour la ruche nouvelle ruche à contacter
| true | true |
f74201e05bdced9050e1207f67c164610553e550 | 297 | py | Python | py4e/course3/parse_xml.py | tofritz/ExampleWork | 6779cce3148f1595fd062e4941aa2697c0a8248d | [
"MIT"
] | null | null | null | py4e/course3/parse_xml.py | tofritz/ExampleWork | 6779cce3148f1595fd062e4941aa2697c0a8248d | [
"MIT"
] | 8 | 2020-02-05T00:44:39.000Z | 2020-02-18T23:11:16.000Z | py4e/course3/parse_xml.py | tofritz/ExampleWork | 6779cce3148f1595fd062e4941aa2697c0a8248d | [
"MIT"
] | null | null | null | import urllib.request, urllib.parse, urllib.error
import xml.etree.ElementTree as ET
url = input('Enter XML URL: ')
data = urllib.request.urlopen(url).read()
tree = ET.fromstring(data)
counts = tree.findall('.//count')
total = 0
for count in counts:
total += int(count.text)
print(total)
| 18.5625 | 49 | 0.710438 | import urllib.request, urllib.parse, urllib.error
import xml.etree.ElementTree as ET
url = input('Enter XML URL: ')
data = urllib.request.urlopen(url).read()
tree = ET.fromstring(data)
counts = tree.findall('.//count')
total = 0
for count in counts:
total += int(count.text)
print(total)
| true | true |
f74203d05330bca2ca8d7d2e1e8d357166a2d202 | 3,278 | py | Python | venv/Lib/site-packages/astroid/transforms.py | AnxhelaMehmetaj/is219_flask | 1e88579f14a96c9826e9452b3c7f8e6477577ef7 | [
"BSD-3-Clause"
] | null | null | null | venv/Lib/site-packages/astroid/transforms.py | AnxhelaMehmetaj/is219_flask | 1e88579f14a96c9826e9452b3c7f8e6477577ef7 | [
"BSD-3-Clause"
] | null | null | null | venv/Lib/site-packages/astroid/transforms.py | AnxhelaMehmetaj/is219_flask | 1e88579f14a96c9826e9452b3c7f8e6477577ef7 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
# For details: https://github.com/PyCQA/astroid/blob/main/LICENSE
# Copyright (c) https://github.com/PyCQA/astroid/blob/main/CONTRIBUTORS.txt
import collections
from functools import lru_cache
from astroid.context import _invalidate... | 36.831461 | 85 | 0.638499 |
import collections
from functools import lru_cache
from astroid.context import _invalidate_cache
class TransformVisitor:
TRANSFORM_MAX_CACHE_SIZE = 10000
def __init__(self):
self.transforms = collections.defaultdict(list)
@lru_cache(maxsize=TRANSFORM_MAX_CACHE_SIZE)
def _transform(self... | true | true |
f7420637d661263f0ca2012d29afbb8266ce8d61 | 7,219 | py | Python | ietf/meeting/admin.py | hassanakbar4/ietfdb | cabee059092ae776015410640226064331c293b7 | [
"BSD-3-Clause"
] | null | null | null | ietf/meeting/admin.py | hassanakbar4/ietfdb | cabee059092ae776015410640226064331c293b7 | [
"BSD-3-Clause"
] | 39 | 2021-05-31T21:10:14.000Z | 2022-03-07T16:07:14.000Z | ietf/meeting/admin.py | hassanakbar4/ietfdb | cabee059092ae776015410640226064331c293b7 | [
"BSD-3-Clause"
] | 2 | 2021-10-05T12:48:20.000Z | 2021-11-08T11:38:35.000Z | # Copyright The IETF Trust 2012-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from django.contrib import admin
from ietf.meeting.models import (Meeting, Room, Session, TimeSlot, Constraint, Schedule,
SchedTimeSessAssignment, ResourceAssociation, FloorPlan, UrlResource,
SessionPresentation, ImportantDate,... | 35.387255 | 115 | 0.694556 |
from django.contrib import admin
from ietf.meeting.models import (Meeting, Room, Session, TimeSlot, Constraint, Schedule,
SchedTimeSessAssignment, ResourceAssociation, FloorPlan, UrlResource,
SessionPresentation, ImportantDate, SlideSubmission, SchedulingEvent, BusinessConstraint,
ProceedingsMaterial, ... | true | true |
f7420644022905c1b99d9fab7238d24a3a18144d | 14,142 | py | Python | Lib/site-packages/sqlalchemy/testing/exclusions.py | Carshy/blogApplication | a471cd8627510ebc2bd3ba213fe2dbe6e4eca60f | [
"bzip2-1.0.6"
] | 4 | 2020-06-06T02:29:28.000Z | 2021-07-22T17:06:40.000Z | Lib/site-packages/sqlalchemy/testing/exclusions.py | Carshy/blogApplication | a471cd8627510ebc2bd3ba213fe2dbe6e4eca60f | [
"bzip2-1.0.6"
] | 44 | 2020-07-21T10:40:23.000Z | 2020-08-03T17:34:21.000Z | Lib/site-packages/sqlalchemy/testing/exclusions.py | Carshy/blogApplication | a471cd8627510ebc2bd3ba213fe2dbe6e4eca60f | [
"bzip2-1.0.6"
] | 2 | 2020-01-16T06:35:46.000Z | 2020-01-16T06:48:06.000Z | # testing/exclusions.py
# Copyright (C) 2005-2019 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import contextlib
import operator
import re
from . import config
from .. imp... | 29.4625 | 79 | 0.583439 |
import contextlib
import operator
import re
from . import config
from .. import util
from ..util import decorator
from ..util.compat import inspect_getfullargspec
def skip_if(predicate, reason=None):
rule = compound()
pred = _as_predicate(predicate, reason)
rule.skips.add(pred)
return rule
... | true | true |
f74206e20ea65a2877cac5cb7dadcacfa8a19ff6 | 5,730 | py | Python | uncertainty_baselines/models/__init__.py | ranganathkrishnan/uncertainty-baselines | b9c6b870790034c1a2303246f887fd2cf53bff38 | [
"Apache-2.0"
] | 1 | 2022-03-03T15:35:12.000Z | 2022-03-03T15:35:12.000Z | uncertainty_baselines/models/__init__.py | ranganathkrishnan/uncertainty-baselines | b9c6b870790034c1a2303246f887fd2cf53bff38 | [
"Apache-2.0"
] | null | null | null | uncertainty_baselines/models/__init__.py | ranganathkrishnan/uncertainty-baselines | b9c6b870790034c1a2303246f887fd2cf53bff38 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The Uncertainty Baselines Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 54.056604 | 118 | 0.861606 |
from absl import logging
import tensorflow as tf
from uncertainty_baselines.models import efficientnet_utils
from uncertainty_baselines.models.criteo_mlp import criteo_mlp
from uncertainty_baselines.models.efficientnet import efficientnet
from uncertainty_baselines.models.efficientnet_batch_ensemble im... | true | true |
f7420b1caa664cf6764e3eacfd49e226c7bd722e | 1,060 | py | Python | Lib/site-packages/PyQt5/uic/port_v3/string_io.py | heylenz/python27 | bee49fa9d65b8ab7d591146a5b6cd47aeb41d940 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | Lib/site-packages/PyQt5/uic/port_v3/string_io.py | heylenz/python27 | bee49fa9d65b8ab7d591146a5b6cd47aeb41d940 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | Lib/site-packages/PyQt5/uic/port_v3/string_io.py | heylenz/python27 | bee49fa9d65b8ab7d591146a5b6cd47aeb41d940 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | #############################################################################
##
## Copyright (c) 2013 Riverbank Computing Limited <info@riverbankcomputing.com>
##
## This file is part of PyQt5.
##
## This file may be used under the terms of the GNU General Public License
## version 3.0 as published by the Free Softw... | 42.4 | 79 | 0.643396 | true | true | |
f7420ba4619ae917fc73259a2e194f196cd6f6b6 | 9,814 | py | Python | renjun/blockchain base.py | FYQ0919/Your_First_Decentralized_Application_Python | 21afb71a79c798c02a972eec6d54b4a17526358b | [
"MIT"
] | 2 | 2020-10-12T06:17:23.000Z | 2020-10-14T18:12:37.000Z | renjun/blockchain base.py | FYQ0919/Your_First_Decentralized_Application_Python | 21afb71a79c798c02a972eec6d54b4a17526358b | [
"MIT"
] | null | null | null | renjun/blockchain base.py | FYQ0919/Your_First_Decentralized_Application_Python | 21afb71a79c798c02a972eec6d54b4a17526358b | [
"MIT"
] | null | null | null | '''
Blockchain base prepared by Ren Jun in April 2019 with reference from ??.
Run blockchain base before running any of the simulation.
This code is to prepare one starting block of the blockchain, which is a passive block without any data,
and also, the function to add subsequent blocks to the blockchain by getting d... | 29.383234 | 176 | 0.599654 |
import hashlib
import json
from time import time
from urllib.parse import urlparse
from uuid import uuid4
import requests
from flask import Flask, jsonify, request
class Blockchain:
def __init__(self):
self.current_transactions = ['Start']
self.chain = []
self.nodes = set()
... | true | true |
f7420d2da066af30e3adf4d249d2a4b8a0053933 | 457 | py | Python | join.py | carderne/msoa-income | 2cfaef3e1942ba6f97b963cbc02472a154fae6d6 | [
"MIT"
] | null | null | null | join.py | carderne/msoa-income | 2cfaef3e1942ba6f97b963cbc02472a154fae6d6 | [
"MIT"
] | null | null | null | join.py | carderne/msoa-income | 2cfaef3e1942ba6f97b963cbc02472a154fae6d6 | [
"MIT"
] | null | null | null | import sys
import pandas as pd
import geopandas as gpd
def main(csv, gpkg, out):
df = pd.read_csv(csv).assign(
Income=lambda x: pd.to_numeric(x.Income.str.replace(",", ""))
)
gpd.read_file(gpkg).get(["MSOA01CD", "geometry"]).merge(
df, how="inner", left_on="MSOA01CD", right_on="MSOA"
... | 20.772727 | 69 | 0.608315 | import sys
import pandas as pd
import geopandas as gpd
def main(csv, gpkg, out):
df = pd.read_csv(csv).assign(
Income=lambda x: pd.to_numeric(x.Income.str.replace(",", ""))
)
gpd.read_file(gpkg).get(["MSOA01CD", "geometry"]).merge(
df, how="inner", left_on="MSOA01CD", right_on="MSOA"
... | true | true |
f7420d6b6cc229c4605f7a33be752915acbbb2b6 | 1,929 | py | Python | Source/lstm.py | SamanKhamesian/Human-Activity-Recognition-Time-Series-Classification | 1b1d8474997ddf3c0f22791acecdfd823b9de5fd | [
"Apache-2.0"
] | 6 | 2020-11-30T03:03:58.000Z | 2021-08-10T19:29:38.000Z | Source/lstm.py | SamanKhamesian/Human-Activity-Recognition-Time-Series-Classification | 1b1d8474997ddf3c0f22791acecdfd823b9de5fd | [
"Apache-2.0"
] | 3 | 2020-11-30T03:18:07.000Z | 2021-07-08T07:41:18.000Z | Source/lstm.py | SamanKhamesian/Human-Activity-Recognition-Time-Series-Classification | 1b1d8474997ddf3c0f22791acecdfd823b9de5fd | [
"Apache-2.0"
] | 2 | 2021-04-14T13:50:50.000Z | 2021-07-18T22:29:14.000Z | import os
import tensorflow as tf
from keras.layers import LSTM, Dense, Dropout
from keras.models import Sequential
from Source.config import Model
from Source.driver import Driver
tf.logging.set_verbosity(tf.logging.ERROR)
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
def run():
dataset = Driver()
n_time_step... | 35.722222 | 101 | 0.715397 | import os
import tensorflow as tf
from keras.layers import LSTM, Dense, Dropout
from keras.models import Sequential
from Source.config import Model
from Source.driver import Driver
tf.logging.set_verbosity(tf.logging.ERROR)
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
def run():
dataset = Driver()
n_time_step... | true | true |
f7420d8378ce975687fa683c35fcd94a511ec490 | 357 | py | Python | backend/app/database/database.py | Michal-Miko/competitive-teams | 6bb55542e06121f413248ddf0b75285296b610bb | [
"MIT"
] | null | null | null | backend/app/database/database.py | Michal-Miko/competitive-teams | 6bb55542e06121f413248ddf0b75285296b610bb | [
"MIT"
] | null | null | null | backend/app/database/database.py | Michal-Miko/competitive-teams | 6bb55542e06121f413248ddf0b75285296b610bb | [
"MIT"
] | null | null | null | from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from os import getenv
SQLALCHEMY_DATABASE_URL = getenv("DATABASE_URL")
engine = create_engine(SQLALCHEMY_DATABASE_URL)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bin... | 29.75 | 75 | 0.845938 | from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from os import getenv
SQLALCHEMY_DATABASE_URL = getenv("DATABASE_URL")
engine = create_engine(SQLALCHEMY_DATABASE_URL)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bin... | true | true |
f7420dbbd758df6ab201185302ea91228a0259ca | 2,343 | py | Python | Edges/workers/Worker.py | faramarzQ/Cloud_assisted_resource_allocation_using_machine_learning | 1aa8d8e63dcd6053f69e17bf90595a0aa2a7d317 | [
"Apache-2.0"
] | 1 | 2022-03-14T01:44:28.000Z | 2022-03-14T01:44:28.000Z | Edges/workers/Worker.py | faramarzQ/Cloud_assisted_resource_allocation_using_machine_learning | 1aa8d8e63dcd6053f69e17bf90595a0aa2a7d317 | [
"Apache-2.0"
] | null | null | null | Edges/workers/Worker.py | faramarzQ/Cloud_assisted_resource_allocation_using_machine_learning | 1aa8d8e63dcd6053f69e17bf90595a0aa2a7d317 | [
"Apache-2.0"
] | 1 | 2021-08-04T08:30:58.000Z | 2021-08-04T08:30:58.000Z |
class Worker():
def __init__(self):
""" initialize Worker class
"""
self.cloudlets = []
self.bandwidth = {}
self.mips = int
self.position = int
self.timer = 0
def attachCloudlet(self, cloudlet):
""" attach cloudlet to worker
Args:
... | 30.038462 | 85 | 0.51003 |
class Worker():
def __init__(self):
self.cloudlets = []
self.bandwidth = {}
self.mips = int
self.position = int
self.timer = 0
def attachCloudlet(self, cloudlet):
self.cloudlets.append(cloudlet)
def run(self):
for cloudlet in self.cloudlets:
... | true | true |
f7420ebbec6d43b0e5c6c988489095100cbfe534 | 7,365 | py | Python | test/e2e/live_cluster/test_info.py | jfwm2/aerospike-admin | 3ce721bbd249eca73046345620941a6aef325589 | [
"Apache-2.0"
] | null | null | null | test/e2e/live_cluster/test_info.py | jfwm2/aerospike-admin | 3ce721bbd249eca73046345620941a6aef325589 | [
"Apache-2.0"
] | null | null | null | test/e2e/live_cluster/test_info.py | jfwm2/aerospike-admin | 3ce721bbd249eca73046345620941a6aef325589 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013-2021 Aerospike, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 30.6875 | 105 | 0.57461 |
import unittest
from lib.view.sheet import set_style_json
import lib.live_cluster.live_cluster_root_controller as controller
import lib.utils.util as util
from test.e2e import util as test_util
set_style_json()
class TestInfo(unittest.TestCase):
rc = None
output_list = list()
service_info... | true | true |
f7421039b0e769a44cd5256eb710be07db933fc9 | 4,850 | py | Python | handlers/card_handler.py | HearthSim/HearthBot | 4fc4fbf24f816c7fc2075849b2ad747965fa4204 | [
"MIT"
] | 8 | 2018-04-26T13:01:24.000Z | 2021-04-04T02:34:11.000Z | handlers/card_handler.py | HearthSim/HearthBot | 4fc4fbf24f816c7fc2075849b2ad747965fa4204 | [
"MIT"
] | 4 | 2017-08-26T13:01:15.000Z | 2019-09-14T21:58:44.000Z | handlers/card_handler.py | HearthSim/HearthBot | 4fc4fbf24f816c7fc2075849b2ad747965fa4204 | [
"MIT"
] | 11 | 2017-04-18T17:52:22.000Z | 2021-05-08T19:10:46.000Z | import re
from hearthstone import cardxml
from hearthstone.cardxml import CardXML
from hearthstone.enums import CardType, GameTag, Race, Rarity
ERR_LANG_NOT_FOUND = "Language not found. Supported language keys are e.g. `enUS` or `deDE`"
db, _ = cardxml.load()
def loc_name(self, locale):
return self.strings[Game... | 28.869048 | 94 | 0.633402 | import re
from hearthstone import cardxml
from hearthstone.cardxml import CardXML
from hearthstone.enums import CardType, GameTag, Race, Rarity
ERR_LANG_NOT_FOUND = "Language not found. Supported language keys are e.g. `enUS` or `deDE`"
db, _ = cardxml.load()
def loc_name(self, locale):
return self.strings[Game... | true | true |
f7421103ba2cf980561213214889bf7c562a5fbd | 1,625 | py | Python | app/core/tests/tests_admin.py | pnsn/squac_api | 7b1741cd32dbc32972f75ac53958468fdf7d04ee | [
"MIT"
] | 6 | 2019-11-07T09:32:43.000Z | 2021-09-02T22:37:14.000Z | app/core/tests/tests_admin.py | pnsn/squacapi | e330a925aff38937656983841e495ba3824c11e1 | [
"MIT"
] | 196 | 2019-10-04T17:03:36.000Z | 2022-03-31T17:54:59.000Z | app/core/tests/tests_admin.py | pnsn/squac_api | 7b1741cd32dbc32972f75ac53958468fdf7d04ee | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import Client
from organization.models import Organization
class AdminSiteTests(TestCase):
def setUp(self):
admin_email = 'admin@pnsn.org'
admin_pass = 'password123'
... | 33.163265 | 68 | 0.648 | from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import Client
from organization.models import Organization
class AdminSiteTests(TestCase):
def setUp(self):
admin_email = 'admin@pnsn.org'
admin_pass = 'password123'
... | true | true |
f7421155086f679794f76826296e13e2251dbf74 | 7,022 | py | Python | src/model/SLIM/SSLIM_BPR.py | riccardopoiani/recsys_2019 | 47a44d2f7d85e76e31dacf4ba2e69721d010b6b8 | [
"MIT"
] | 2 | 2020-10-01T11:08:32.000Z | 2020-11-25T11:05:37.000Z | src/model/SLIM/SSLIM_BPR.py | riccardopoiani/recsys_2019 | 47a44d2f7d85e76e31dacf4ba2e69721d010b6b8 | [
"MIT"
] | null | null | null | src/model/SLIM/SSLIM_BPR.py | riccardopoiani/recsys_2019 | 47a44d2f7d85e76e31dacf4ba2e69721d010b6b8 | [
"MIT"
] | 1 | 2020-10-01T11:08:33.000Z | 2020-10-01T11:08:33.000Z | from course_lib.Base.Recommender_utils import check_matrix
from course_lib.Base.BaseSimilarityMatrixRecommender import BaseItemSimilarityMatrixRecommender
from course_lib.Base.Recommender_utils import similarityMatrixTopK
from course_lib.Base.Incremental_Training_Early_Stopping import Incremental_Training_Early_Stoppin... | 42.301205 | 152 | 0.608659 | from course_lib.Base.Recommender_utils import check_matrix
from course_lib.Base.BaseSimilarityMatrixRecommender import BaseItemSimilarityMatrixRecommender
from course_lib.Base.Recommender_utils import similarityMatrixTopK
from course_lib.Base.Incremental_Training_Early_Stopping import Incremental_Training_Early_Stoppin... | true | true |
f74211b461aa22de6a02638850beb03044fa3455 | 1,134 | py | Python | axelrod/tests/strategies/test_negation.py | nandhinianandj/Axelrod | 379b907d64c51816a50abfd8480240276c893953 | [
"MIT"
] | 596 | 2015-03-30T17:34:14.000Z | 2022-03-21T19:32:38.000Z | axelrod/tests/strategies/test_negation.py | nandhinianandj/Axelrod | 379b907d64c51816a50abfd8480240276c893953 | [
"MIT"
] | 1,018 | 2015-03-30T14:57:33.000Z | 2022-03-14T14:57:48.000Z | axelrod/tests/strategies/test_negation.py | nandhinianandj/Axelrod | 379b907d64c51816a50abfd8480240276c893953 | [
"MIT"
] | 263 | 2015-03-31T10:26:28.000Z | 2022-03-29T09:26:02.000Z | """Tests for the Neg Strategy"""
import axelrod as axl
from .test_player import TestPlayer
C, D = axl.Action.C, axl.Action.D
class TestNegation(TestPlayer):
name = "Negation"
player = axl.Negation
expected_classifier = {
"memory_depth": 1,
"stochastic": True,
"makes_use_of": se... | 27 | 71 | 0.560847 |
import axelrod as axl
from .test_player import TestPlayer
C, D = axl.Action.C, axl.Action.D
class TestNegation(TestPlayer):
name = "Negation"
player = axl.Negation
expected_classifier = {
"memory_depth": 1,
"stochastic": True,
"makes_use_of": set(),
"long_run_time": Fal... | true | true |
f74212f2159b3a40a39e82599691a64e90f98877 | 2,917 | py | Python | python/arcade/02_trees.py | jwatson-CO-edu/nanoverse | 20ec7c5e641bad5e2e10534d5e9f0d6d189a297b | [
"MIT"
] | null | null | null | python/arcade/02_trees.py | jwatson-CO-edu/nanoverse | 20ec7c5e641bad5e2e10534d5e9f0d6d189a297b | [
"MIT"
] | null | null | null | python/arcade/02_trees.py | jwatson-CO-edu/nanoverse | 20ec7c5e641bad5e2e10534d5e9f0d6d189a297b | [
"MIT"
] | null | null | null | """
This is a sample program to show how to draw using the Python programming
language and the Arcade library.
"""
# Import the "arcade" library
import arcade
# Open up a window.
# From the "arcade" library, use a function called "open_window"
# Set the window title to "Drawing Example"
# Set the dimensions (width an... | 36.924051 | 88 | 0.693521 |
import arcade
arcade.open_window( 600, 600, "Drawing Example" )
arcade.set_background_color( arcade.csscolor.SKY_BLUE )
arcade.start_render()
arcade.draw_lrtb_rectangle_filled( 0, 599, 300, 0, arcade.csscolor.GREEN )
arcade.draw_rectangle_filled( 100, 320, 20, 60, arcade.csscolor.SIENNA )
arcade.draw... | true | true |
f74214f8616adf2de0b654e562f43b4add02138a | 411 | py | Python | OBB_Train_Station/wsgi.py | marcmelchor/OBB-Train-Station | 6371f2a27205f20289afd1842ad055106d732158 | [
"MIT"
] | null | null | null | OBB_Train_Station/wsgi.py | marcmelchor/OBB-Train-Station | 6371f2a27205f20289afd1842ad055106d732158 | [
"MIT"
] | 3 | 2019-12-04T23:14:40.000Z | 2021-03-01T19:02:22.000Z | OBB_Train_Station/wsgi.py | marcmelchor/OBB-Train-Station | 6371f2a27205f20289afd1842ad055106d732158 | [
"MIT"
] | null | null | null | """
WSGI config for OBB_Train_Station project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJ... | 24.176471 | 78 | 0.79562 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'OBB_Train_Station.settings')
application = get_wsgi_application()
| true | true |
f74214f9360641816d6d299d36ab80932bf127de | 1,890 | py | Python | essai polygon.py | PnMercantour/suivi_zh | 724609c4988ba85f47356490873a4ea8c092c95a | [
"MIT"
] | null | null | null | essai polygon.py | PnMercantour/suivi_zh | 724609c4988ba85f47356490873a4ea8c092c95a | [
"MIT"
] | null | null | null | essai polygon.py | PnMercantour/suivi_zh | 724609c4988ba85f47356490873a4ea8c092c95a | [
"MIT"
] | null | null | null | from logging import log
import dash
import dash_leaflet as dl
import dash_leaflet.express as dlx
from dash.dependencies import Input, Output
from dash_extensions.javascript import assign, arrow_function
import pandas as pd
import dash_html_components as html
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWL... | 33.157895 | 92 | 0.640741 | from logging import log
import dash
import dash_leaflet as dl
import dash_leaflet.express as dlx
from dash.dependencies import Input, Output
from dash_extensions.javascript import assign, arrow_function
import pandas as pd
import dash_html_components as html
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWL... | true | true |
f74215657f9662796c652bd155019ab043315fbc | 2,858 | py | Python | rclpy/test/test_serialization.py | RoboStack/rclpy | c67e43a69a1580eeac4a90767e24ceeea31a298e | [
"Apache-2.0"
] | 121 | 2015-11-19T19:46:09.000Z | 2022-03-17T16:36:52.000Z | rclpy/test/test_serialization.py | RoboStack/rclpy | c67e43a69a1580eeac4a90767e24ceeea31a298e | [
"Apache-2.0"
] | 759 | 2016-01-29T01:44:19.000Z | 2022-03-30T13:37:26.000Z | rclpy/test/test_serialization.py | RoboStack/rclpy | c67e43a69a1580eeac4a90767e24ceeea31a298e | [
"Apache-2.0"
] | 160 | 2016-01-12T16:56:21.000Z | 2022-03-22T23:20:35.000Z | # Copyright 2020 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 38.621622 | 87 | 0.771868 |
import pytest
from rclpy.serialization import deserialize_message
from rclpy.serialization import serialize_message
from test_msgs.message_fixtures import get_test_msg
from test_msgs.msg import Arrays
from test_msgs.msg import BasicTypes
from test_msgs.msg import BoundedSequences
from test_msgs.msg impo... | true | true |
f74216515895d7f79a72c0f8cd02e9603aa01918 | 15,184 | py | Python | lib/taurus/qt/qtgui/input/tauruscombobox.py | cpascual/taurus | 1786e741418f1d3ecf8f00243ec7ebe2493a3c99 | [
"CC-BY-3.0"
] | 1 | 2016-10-19T13:54:08.000Z | 2016-10-19T13:54:08.000Z | lib/taurus/qt/qtgui/input/tauruscombobox.py | cpascual/taurus | 1786e741418f1d3ecf8f00243ec7ebe2493a3c99 | [
"CC-BY-3.0"
] | 27 | 2016-05-25T08:56:58.000Z | 2019-01-21T09:18:08.000Z | lib/taurus/qt/qtgui/input/tauruscombobox.py | cpascual/taurus | 1786e741418f1d3ecf8f00243ec7ebe2493a3c99 | [
"CC-BY-3.0"
] | 8 | 2015-07-24T09:16:50.000Z | 2018-06-12T12:33:59.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#############################################################################
##
# This file is part of Taurus
##
# http://taurus-scada.org
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Taurus is free software: you can redistribute it and/or modify
#... | 37.771144 | 143 | 0.556902 |
stComboBox(Qt.QComboBox, TaurusBaseWidget):
def __init__(self, parent=None, designMode=False):
name = self.__class__.__name__
self.call__init__wo_kw(Qt.QComboBox, parent)
self.call__init__(TaurusBaseWidget, name)
self.insertEventFilter(eventfilters.IGNORE_CONFIG)
self.set... | true | true |
f742168122346151540395090d876f91489b704e | 5,206 | py | Python | sundial/price_model/parameter_tuning.py | UWSEDS-aut17/uwseds-group-maximize-savings-in-clean-energy | c485c5e1f5bea1135b013835d28227f858a68c4d | [
"MIT"
] | null | null | null | sundial/price_model/parameter_tuning.py | UWSEDS-aut17/uwseds-group-maximize-savings-in-clean-energy | c485c5e1f5bea1135b013835d28227f858a68c4d | [
"MIT"
] | 6 | 2017-11-15T21:51:02.000Z | 2017-11-16T05:07:45.000Z | sundial/price_model/parameter_tuning.py | UWSEDS-aut17/SunDial | c485c5e1f5bea1135b013835d28227f858a68c4d | [
"MIT"
] | 2 | 2019-05-09T22:23:13.000Z | 2019-07-10T01:53:18.000Z | import numpy as np
from matplotlib import pyplot as plt
import seaborn as sns
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn import linear_model
from sklearn import neighbors
from sklearn import svm
from sklearn.model_selection import GridSearchCV
from sundial.price_model.utils.fi... | 30.623529 | 79 | 0.670572 | import numpy as np
from matplotlib import pyplot as plt
import seaborn as sns
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn import linear_model
from sklearn import neighbors
from sklearn import svm
from sklearn.model_selection import GridSearchCV
from sundial.price_model.utils.fi... | true | true |
f74216e58d1ef59d52d2d994e4dd8311a98cf26f | 4,859 | py | Python | demo/work_pretty_trio.py | yosukefk/plotter | 16127ee7fc3105c717e92875ee3d61477bd41533 | [
"MIT"
] | null | null | null | demo/work_pretty_trio.py | yosukefk/plotter | 16127ee7fc3105c717e92875ee3d61477bd41533 | [
"MIT"
] | 6 | 2021-05-25T15:51:27.000Z | 2021-08-18T20:39:41.000Z | demo/work_pretty_trio.py | yosukefk/plotter | 16127ee7fc3105c717e92875ee3d61477bd41533 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
plotterdir = '..'
sys.path.insert(0, plotterdir)
from plotter import calpost_reader
import plotter.plotter_multi as plotter_multi
from plotter.plotter_util import LambertConformalTCEQ
from plotter.plotter_background import BackgroundManager
import cartopy.crs as ccrs
import geopanda... | 28.086705 | 101 | 0.615147 |
import sys
plotterdir = '..'
sys.path.insert(0, plotterdir)
from plotter import calpost_reader
import plotter.plotter_multi as plotter_multi
from plotter.plotter_util import LambertConformalTCEQ
from plotter.plotter_background import BackgroundManager
import cartopy.crs as ccrs
import geopandas as gpd
import matplo... | true | true |
f74216f426dbc31123e0f8346e16ada73510a9f0 | 1,651 | py | Python | backend/src/photoImposer.py | jayeshjakkani/American-Football-Analytics-Application | 54609c0ea1b635425e4edad08f3414bcf3d05459 | [
"MIT"
] | null | null | null | backend/src/photoImposer.py | jayeshjakkani/American-Football-Analytics-Application | 54609c0ea1b635425e4edad08f3414bcf3d05459 | [
"MIT"
] | null | null | null | backend/src/photoImposer.py | jayeshjakkani/American-Football-Analytics-Application | 54609c0ea1b635425e4edad08f3414bcf3d05459 | [
"MIT"
] | 1 | 2020-10-26T20:52:44.000Z | 2020-10-26T20:52:44.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from photoCoordinates import photoCoordinates
from PIL import Image, ImageFont, ImageDraw
class photoImposer:
pc = photoCoordinates()
allCoordinates = pc.allCoordinates
all_images = {}
def __init__(self):
self.all_images['KICKOFF'] = "formation... | 40.268293 | 123 | 0.643852 |
from photoCoordinates import photoCoordinates
from PIL import Image, ImageFont, ImageDraw
class photoImposer:
pc = photoCoordinates()
allCoordinates = pc.allCoordinates
all_images = {}
def __init__(self):
self.all_images['KICKOFF'] = "formationImages/kickoff_coverage.png"
self.all... | true | true |
f742178115791ddefe5a0f1456b4cc9f0c4ef4bc | 4,078 | py | Python | syft/federated/federated_client.py | theoptips/PySyft | 4b68c3c6fbe0c18cdf87dfe6ddc3c2071a71f1cc | [
"Apache-2.0"
] | 1 | 2019-08-27T21:48:50.000Z | 2019-08-27T21:48:50.000Z | syft/federated/federated_client.py | theoptips/PySyft | 4b68c3c6fbe0c18cdf87dfe6ddc3c2071a71f1cc | [
"Apache-2.0"
] | null | null | null | syft/federated/federated_client.py | theoptips/PySyft | 4b68c3c6fbe0c18cdf87dfe6ddc3c2071a71f1cc | [
"Apache-2.0"
] | null | null | null | import torch as th
from torch.utils.data import BatchSampler, RandomSampler, SequentialSampler
from syft.generic import ObjectStorage
from syft.federated.train_config import TrainConfig
class FederatedClient(ObjectStorage):
"""A Client able to execute federated learning in local datasets."""
def __init__(se... | 33.42623 | 95 | 0.615253 | import torch as th
from torch.utils.data import BatchSampler, RandomSampler, SequentialSampler
from syft.generic import ObjectStorage
from syft.federated.train_config import TrainConfig
class FederatedClient(ObjectStorage):
def __init__(self, datasets=None):
super().__init__()
self.datasets = da... | true | true |
f74218219100926c9b72b62eb0646106e594d558 | 814 | py | Python | lgp/geometry/transform.py | humans-to-robots-motion/lgp | f62da0c0cb7a209eb90848cce8eddc91c14fa099 | [
"MIT"
] | 1 | 2022-01-08T13:53:05.000Z | 2022-01-08T13:53:05.000Z | lgp/geometry/transform.py | humans-to-robots-motion/lgp | f62da0c0cb7a209eb90848cce8eddc91c14fa099 | [
"MIT"
] | 1 | 2022-01-21T07:52:34.000Z | 2022-01-21T07:52:34.000Z | lgp/geometry/transform.py | humans-to-robots-motion/lgp | f62da0c0cb7a209eb90848cce8eddc91c14fa099 | [
"MIT"
] | 2 | 2021-02-16T15:54:10.000Z | 2021-12-07T14:22:08.000Z | import numpy as np
from pyrieef.geometry.differentiable_geometry import DifferentiableMap
class LinearTranslation(DifferentiableMap):
"""
Simple linear translation
"""
def __init__(self, p0=np.zeros(2)):
assert isinstance(p0, np.ndarray)
self._p = p0
def forward(self, q):
... | 24.666667 | 70 | 0.653563 | import numpy as np
from pyrieef.geometry.differentiable_geometry import DifferentiableMap
class LinearTranslation(DifferentiableMap):
def __init__(self, p0=np.zeros(2)):
assert isinstance(p0, np.ndarray)
self._p = p0
def forward(self, q):
assert q.shape[0] == self.input_dimension
... | true | true |
f742185bf3b9484233e61df21912202df91b692f | 1,853 | py | Python | flod_facilities_backend/validation/credential_validators.py | Trondheim-kommune/Bookingbasen | 58235a5a1fd6ad291cb237e6ec9a67bfe8c463c6 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2017-10-17T12:15:28.000Z | 2017-10-17T12:15:28.000Z | flod_facilities_backend/validation/credential_validators.py | Trondheim-kommune/Bookingbasen | 58235a5a1fd6ad291cb237e6ec9a67bfe8c463c6 | [
"BSD-2-Clause-FreeBSD"
] | 6 | 2021-03-22T17:15:52.000Z | 2022-01-13T00:39:58.000Z | flod_facilities_backend/validation/credential_validators.py | Trondheim-kommune/Bookingbasen | 58235a5a1fd6ad291cb237e6ec9a67bfe8c463c6 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2019-09-09T13:35:03.000Z | 2019-09-09T13:35:03.000Z | # -*- coding: utf-8 -*-
from flask import request, current_app
from domain.models import Image, Document
from validation.base_validators import ParameterizedValidator
import repo
class CanCreateFacilityValidator(ParameterizedValidator):
def validate(self, f, *args, **kwargs):
user_id = repo.get_user_id_f... | 45.195122 | 98 | 0.657312 |
from flask import request, current_app
from domain.models import Image, Document
from validation.base_validators import ParameterizedValidator
import repo
class CanCreateFacilityValidator(ParameterizedValidator):
def validate(self, f, *args, **kwargs):
user_id = repo.get_user_id_for_user(cookies=request... | true | true |
f74218a652b58014e64850fcc512135f4d8a5a3d | 5,248 | py | Python | rgg_ensemble_analysis/Statistics_Computation.py | MGarrod1/rgg_ensemble_analysis | 679ea7b11c0eae4d92eef9f08fe9c63dcfd3837c | [
"MIT"
] | null | null | null | rgg_ensemble_analysis/Statistics_Computation.py | MGarrod1/rgg_ensemble_analysis | 679ea7b11c0eae4d92eef9f08fe9c63dcfd3837c | [
"MIT"
] | null | null | null | rgg_ensemble_analysis/Statistics_Computation.py | MGarrod1/rgg_ensemble_analysis | 679ea7b11c0eae4d92eef9f08fe9c63dcfd3837c | [
"MIT"
] | null | null | null | """
Functions to compute various statistics of the data
and their associated errors.
"""
#Compute statistics about the variance of an estimator:
import numpy as np
from scipy import stats
import math
#The following functions as involved in estimating the standard
def Moment(Sample,k) :
"""
This function com... | 20.5 | 288 | 0.68064 |
import numpy as np
from scipy import stats
import math
def Moment(Sample,k) :
Mean = np.mean(Sample)
Moment = 0.0
for i in range(0,len(Sample) ) :
Moment = Moment + (Mean - Sample[i] )**k
return Moment/(len(Sample))
def D4(Sample) :
M = float( len(Sample) )
D4 = ((M-1)/(M**3))*( (M**2 - 3*M + 3... | true | true |
f7421b12fe5a143ea38630139185a216a4d89962 | 9,679 | py | Python | saleor/graphql/core/connection.py | tgarbowski/saleor | 11218aeac8649112626c8f971ef3eec8378b5537 | [
"CC-BY-4.0"
] | null | null | null | saleor/graphql/core/connection.py | tgarbowski/saleor | 11218aeac8649112626c8f971ef3eec8378b5537 | [
"CC-BY-4.0"
] | 8 | 2022-02-14T04:25:58.000Z | 2022-03-28T04:53:16.000Z | saleor/graphql/core/connection.py | tgarbowski/saleor | 11218aeac8649112626c8f971ef3eec8378b5537 | [
"CC-BY-4.0"
] | null | null | null | import json
from typing import Any, Dict, Iterable, List, Tuple, Union
import graphene
from django.db.models import Model as DjangoModel, Q, QuerySet
from graphene.relay.connection import Connection
from graphene_django.types import DjangoObjectType
from graphql.error import GraphQLError
from graphql_relay.connection.... | 34.080986 | 87 | 0.673003 | import json
from typing import Any, Dict, Iterable, List, Tuple, Union
import graphene
from django.db.models import Model as DjangoModel, Q, QuerySet
from graphene.relay.connection import Connection
from graphene_django.types import DjangoObjectType
from graphql.error import GraphQLError
from graphql_relay.connection.... | true | true |
f7421b1eb505298bdde11af41aa3cb292f25adeb | 1,130 | py | Python | tests/storage/cases/test_KT1HYegMXP5pqPe83SbeYdHuJZub4tuG2ZvN.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2021-05-20T16:52:08.000Z | 2021-05-20T16:52:08.000Z | tests/storage/cases/test_KT1HYegMXP5pqPe83SbeYdHuJZub4tuG2ZvN.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2020-12-30T16:44:56.000Z | 2020-12-30T16:44:56.000Z | tests/storage/cases/test_KT1HYegMXP5pqPe83SbeYdHuJZub4tuG2ZvN.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2022-03-20T19:01:00.000Z | 2022-03-20T19:01:00.000Z | from unittest import TestCase
from tests import get_data
from pytezos.michelson.converter import build_schema, decode_micheline, encode_micheline, micheline_to_michelson
class StorageTestKT1HYegMXP5pqPe83SbeYdHuJZub4tuG2ZvN(TestCase):
@classmethod
def setUpClass(cls):
cls.maxDiff = None
cls.... | 40.357143 | 112 | 0.748673 | from unittest import TestCase
from tests import get_data
from pytezos.michelson.converter import build_schema, decode_micheline, encode_micheline, micheline_to_michelson
class StorageTestKT1HYegMXP5pqPe83SbeYdHuJZub4tuG2ZvN(TestCase):
@classmethod
def setUpClass(cls):
cls.maxDiff = None
cls.... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.