hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f741a5ff6f02ace97afdcef1b4f5a26bf9db8a3c | 12,759 | py | Python | datasetinsights/estimators/deeplab.py | BlairLee/dataset-insights | 892e2ed3a2facf97cfa3a883700830d959a0c49b | [
"Apache-2.0"
] | 1 | 2020-08-11T22:28:28.000Z | 2020-08-11T22:28:28.000Z | datasetinsights/estimators/deeplab.py | BlairLee/dataset-insights | 892e2ed3a2facf97cfa3a883700830d959a0c49b | [
"Apache-2.0"
] | null | null | null | datasetinsights/estimators/deeplab.py | BlairLee/dataset-insights | 892e2ed3a2facf97cfa3a883700830d959a0c49b | [
"Apache-2.0"
] | null | null | null | import copy
import logging
import numpy as np
import torch
import torchvision
from ignite.metrics import Loss
from torchvision import transforms as T
from torchvision.transforms import functional as F
import datasetinsights.constants as const
from datasetinsights.data.datasets import Dataset
from datasetinsights.data... | 33.313316 | 79 | 0.606004 | import copy
import logging
import numpy as np
import torch
import torchvision
from ignite.metrics import Loss
from torchvision import transforms as T
from torchvision.transforms import functional as F
import datasetinsights.constants as const
from datasetinsights.data.datasets import Dataset
from datasetinsights.data... | true | true |
f741a6da1dc169ef03673c6ede80660210fac8d3 | 9,473 | py | Python | redisearch/query.py | alancleary/redisearch-py | ed3da46bc2a17b9060d0480c12954bec270b3d50 | [
"BSD-2-Clause"
] | 153 | 2019-01-29T16:01:41.000Z | 2022-02-04T15:44:38.000Z | redisearch/query.py | alancleary/redisearch-py | ed3da46bc2a17b9060d0480c12954bec270b3d50 | [
"BSD-2-Clause"
] | 132 | 2019-02-07T08:22:42.000Z | 2022-02-19T03:09:17.000Z | redisearch/query.py | alancleary/redisearch-py | ed3da46bc2a17b9060d0480c12954bec270b3d50 | [
"BSD-2-Clause"
] | 51 | 2019-03-28T08:18:11.000Z | 2021-12-11T15:57:44.000Z | import six
class Query(object):
"""
Query is used to build complex queries that have more parameters than just the query string.
The query string is set in the constructor, and other options have setter functions.
The setter functions return the query object, so they can be chained,
i.e. `Query("f... | 28.881098 | 120 | 0.57912 | import six
class Query(object):
def __init__(self, query_string):
self._query_string = query_string
self._offset = 0
self._num = 10
self._no_content = False
self._no_stopwords = False
self._fields = None
self._verbatim = False
self._with_payloads = ... | true | true |
f741a70aa069da5dc02c4ac0cec42a832304b996 | 4,814 | py | Python | accounts/migrations/0001_initial.py | FeiChaiCom/django-netdisk | f9ef4f46a065527f0ace0a65f2b3210d1657b80f | [
"MIT"
] | 6 | 2021-05-22T12:23:29.000Z | 2022-01-01T01:38:29.000Z | accounts/migrations/0001_initial.py | gaomugong/django-netdisk | 5b2204f5087579bb6a26c6b92972a9f53bd05a7c | [
"MIT"
] | null | null | null | accounts/migrations/0001_initial.py | gaomugong/django-netdisk | 5b2204f5087579bb6a26c6b92972a9f53bd05a7c | [
"MIT"
] | 1 | 2021-05-22T15:25:33.000Z | 2021-05-22T15:25:33.000Z | # Generated by Django 2.2.18 on 2021-03-21 15:42
import django.contrib.auth.models
from django.db import migrations, models
import django.utils.timezone
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operation... | 46.737864 | 138 | 0.495222 |
import django.contrib.auth.models
from django.db import migrations, models
import django.utils.timezone
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
... | true | true |
f741a74b306a1cb2f96c9869f81b8c615ff69ca6 | 78 | py | Python | pysal/model/__init__.py | sugam45/pysal | 329a37906bf4f5f837de63f169883bdd671cdbda | [
"BSD-3-Clause"
] | null | null | null | pysal/model/__init__.py | sugam45/pysal | 329a37906bf4f5f837de63f169883bdd671cdbda | [
"BSD-3-Clause"
] | null | null | null | pysal/model/__init__.py | sugam45/pysal | 329a37906bf4f5f837de63f169883bdd671cdbda | [
"BSD-3-Clause"
] | null | null | null | import mgwr
import spglm
import spint
import spreg
import spvcm
import tobler
| 11.142857 | 13 | 0.846154 | import mgwr
import spglm
import spint
import spreg
import spvcm
import tobler
| true | true |
f741a75eacd8ca66ccc4d552a6f9f9f185ae93d2 | 1,800 | py | Python | qiskit/extensions/standard/ry.py | ismaila-at-za-ibm/qiskit-terra | 08303ec98ac7b33fde55266dc3a74466fbdcae95 | [
"Apache-2.0"
] | 1 | 2020-09-03T12:28:44.000Z | 2020-09-03T12:28:44.000Z | qiskit/extensions/standard/ry.py | ismaila-at-za-ibm/qiskit-terra | 08303ec98ac7b33fde55266dc3a74466fbdcae95 | [
"Apache-2.0"
] | null | null | null | qiskit/extensions/standard/ry.py | ismaila-at-za-ibm/qiskit-terra | 08303ec98ac7b33fde55266dc3a74466fbdcae95 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2017, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
# pylint: disable=invalid-name
"""
Rotation around the y-axis.
"""
from qiskit.circuit import Gate
from qiskit.circuit impor... | 27.272727 | 78 | 0.642222 |
from qiskit.circuit import Gate
from qiskit.circuit import QuantumCircuit
from qiskit.circuit import QuantumRegister
from qiskit.circuit.decorators import _1q_gate
from qiskit.dagcircuit import DAGCircuit
from qiskit.extensions.standard import header
from qiskit.extensions.standard.u3 import U3Gate
class R... | true | true |
f741a815e5c437a72d4e4468bf4a271ae7700cb5 | 1,900 | py | Python | src/agent/k8s-rest-agent/src/server/urls.py | tianxuanhong/cello | 62aff7bf3038491d5ecacdd9a57946a9ae8a958d | [
"Apache-2.0"
] | 865 | 2017-01-12T21:51:37.000Z | 2022-03-26T16:39:16.000Z | src/agent/k8s-rest-agent/src/server/urls.py | tianxuanhong/cello | 62aff7bf3038491d5ecacdd9a57946a9ae8a958d | [
"Apache-2.0"
] | 226 | 2017-02-06T08:36:24.000Z | 2022-03-30T06:13:46.000Z | src/agent/k8s-rest-agent/src/server/urls.py | tianxuanhong/cello | 62aff7bf3038491d5ecacdd9a57946a9ae8a958d | [
"Apache-2.0"
] | 506 | 2017-02-08T06:11:18.000Z | 2022-03-10T04:25:25.000Z | """server URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 27.142857 | 77 | 0.678947 | import os
from api.routes.hello.views import HelloViewSet
from django.conf import settings
from django.contrib import admin
from django.urls import path, include
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework import permissions
from rest_framework.routers import DefaultRout... | true | true |
f741a8fff3e811cae69217d8b937de65faa70eda | 286 | py | Python | frappe-bench/apps/erpnext/erpnext/assets/doctype/asset_maintenance_team/asset_maintenance_team.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/assets/doctype/asset_maintenance_team/asset_maintenance_team.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/assets/doctype/asset_maintenance_team/asset_maintenance_team.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class AssetMaintenanceTeam(Document):
pass
| 26 | 68 | 0.786713 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class AssetMaintenanceTeam(Document):
pass
| true | true |
f741acc4a9a00160b81ced32280f2e4b3fdc872b | 7,208 | py | Python | puddle/resource/wizard/folder_wizard.py | rwl/puddle | e8fc0b2d6b9b08e60389fc4714a5cf51f628b57f | [
"MIT"
] | 2 | 2016-05-09T15:19:31.000Z | 2019-01-02T06:13:31.000Z | puddle/resource/wizard/folder_wizard.py | rwl/puddle | e8fc0b2d6b9b08e60389fc4714a5cf51f628b57f | [
"MIT"
] | null | null | null | puddle/resource/wizard/folder_wizard.py | rwl/puddle | e8fc0b2d6b9b08e60389fc4714a5cf51f628b57f | [
"MIT"
] | null | null | null | #------------------------------------------------------------------------------
# Copyright (C) 2009 Richard W. Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restrictio... | 34.821256 | 79 | 0.518729 |
""" Defines classes for creating a new folder with a wizard.
"""
from os.path import expanduser, join, exists
from enthought.io.api import File
from enthought.traits.api import \
HasTraits, Directory, Bool, Str, Property, Instance, cached_property, \
Delegate, Event
from enthought.... | false | true |
f741ae49069944f2f734580177743d11ba78e385 | 770 | py | Python | CursoemVideo/Desafio043.py | davihonorato/Curso-python | 47e6b4b2f5b37ef520b8b31d37dba0b5d259a0b0 | [
"MIT"
] | null | null | null | CursoemVideo/Desafio043.py | davihonorato/Curso-python | 47e6b4b2f5b37ef520b8b31d37dba0b5d259a0b0 | [
"MIT"
] | null | null | null | CursoemVideo/Desafio043.py | davihonorato/Curso-python | 47e6b4b2f5b37ef520b8b31d37dba0b5d259a0b0 | [
"MIT"
] | null | null | null | # Desenvolva uma lógica que leia o peso e a altura de uma pessoa, calcule seu IMC e mostre seu status , de acordo com a tabela abaixo;
# abaixo de 18.5: ABAIXO DO PESO; entre 18.5 e 25: PESO IDEAL; 25 até 30: SOBREPESO; 30 até 40: OBESIDADE; acima de 40: OBESIDADE MÓRBIDA;
peso = float(input('Digite o seu peso: '))
al... | 35 | 138 | 0.637662 |
peso = float(input('Digite o seu peso: '))
altura = float(input('Digite a sua altura: '))
imc = peso/altura**2
if imc < 18.5:
print('ABAIXO DO PESO')
print(f'IMC: {imc:.2f}')
elif imc >= 18.5 and imc < 25:
print('PESO IDEAL')
print(f'IMC: {imc:.2f}')
elif imc >= 25 and imc < 30:
print('SOBREPESO... | true | true |
f741aedbd0f51762185d192b011e75e7b3cf729c | 7,928 | py | Python | crawl-ref/source/webserver/server.py | tomdotbradshaw/crawl | 53b51606c3e9e82d1c48a31361246907f715bc3a | [
"CC0-1.0"
] | 4 | 2019-03-20T06:10:25.000Z | 2019-06-24T16:11:53.000Z | crawl-ref/source/webserver/server.py | tomdotbradshaw/crawl | 53b51606c3e9e82d1c48a31361246907f715bc3a | [
"CC0-1.0"
] | null | null | null | crawl-ref/source/webserver/server.py | tomdotbradshaw/crawl | 53b51606c3e9e82d1c48a31361246907f715bc3a | [
"CC0-1.0"
] | 4 | 2019-04-24T23:05:39.000Z | 2019-06-25T05:52:24.000Z | #!/usr/bin/env python
import os, os.path, errno, sys
import tornado.httpserver
import tornado.ioloop
import tornado.web
import tornado.template
import logging, logging.handlers
from config import *
from util import *
from ws_handler import *
from game_data_handler import GameDataHandler
import process_handler
import... | 30.610039 | 104 | 0.612386 |
import os, os.path, errno, sys
import tornado.httpserver
import tornado.ioloop
import tornado.web
import tornado.template
import logging, logging.handlers
from config import *
from util import *
from ws_handler import *
from game_data_handler import GameDataHandler
import process_handler
import userdb
class MainHa... | false | true |
f741af12161393764acd2f025b501543d118bd84 | 1,578 | py | Python | tests/algorithms/image/filter/test_index_of_dispersion.py | dials-src/dials | 25055c1f6164dc33e672e7c5c6a9c5a35e870660 | [
"BSD-3-Clause"
] | 1 | 2021-12-10T17:28:16.000Z | 2021-12-10T17:28:16.000Z | tests/algorithms/image/filter/test_index_of_dispersion.py | dials-src/dials | 25055c1f6164dc33e672e7c5c6a9c5a35e870660 | [
"BSD-3-Clause"
] | null | null | null | tests/algorithms/image/filter/test_index_of_dispersion.py | dials-src/dials | 25055c1f6164dc33e672e7c5c6a9c5a35e870660 | [
"BSD-3-Clause"
] | 1 | 2021-12-07T12:39:04.000Z | 2021-12-07T12:39:04.000Z | from __future__ import annotations
import random
import pytest
def test():
from scitbx.array_family import flex
from dials.algorithms.image.filter import index_of_dispersion_filter
# Create an image
image = flex.random_double(2000 * 2000)
image.reshape(flex.grid(2000, 2000))
mask = flex.ra... | 31.56 | 84 | 0.602028 | from __future__ import annotations
import random
import pytest
def test():
from scitbx.array_family import flex
from dials.algorithms.image.filter import index_of_dispersion_filter
image = flex.random_double(2000 * 2000)
image.reshape(flex.grid(2000, 2000))
mask = flex.random_bool(2000 * ... | true | true |
f741b08bcd0e8501ed6e7827399f3aa97eed0f80 | 5,571 | py | Python | waveform_analysis/_common.py | pirun/waveform_analysis | 66809614b1fc985e694af1720341035316a5ac8e | [
"MIT"
] | 125 | 2017-08-27T01:48:02.000Z | 2022-01-20T10:47:13.000Z | waveform_analysis/_common.py | pirun/waveform_analysis | 66809614b1fc985e694af1720341035316a5ac8e | [
"MIT"
] | 13 | 2017-06-25T14:57:43.000Z | 2022-03-18T19:54:19.000Z | waveform_analysis/_common.py | pirun/waveform_analysis | 66809614b1fc985e694af1720341035316a5ac8e | [
"MIT"
] | 48 | 2017-06-25T10:42:10.000Z | 2022-03-09T18:13:55.000Z | #!/usr/bin/env python
from numpy import array_equal, polyfit, sqrt, mean, absolute, log10, arange
import numpy as np
from scipy.stats import gmean
try:
from soundfile import SoundFile
wav_loader = 'pysoundfile'
except:
try:
from scikits.audiolab import Sndfile
wav_loader = 'scikits.audiola... | 29.951613 | 79 | 0.60061 |
from numpy import array_equal, polyfit, sqrt, mean, absolute, log10, arange
import numpy as np
from scipy.stats import gmean
try:
from soundfile import SoundFile
wav_loader = 'pysoundfile'
except:
try:
from scikits.audiolab import Sndfile
wav_loader = 'scikits.audiolab'
except:
... | true | true |
f741b0ffe31275148ee7713e9589e1aad2776b40 | 2,131 | py | Python | avionix/testing/helpers.py | muthukswamy/avionix | 4463328d8520a10cdcb609805e512f5a9f90ad52 | [
"BSD-3-Clause"
] | null | null | null | avionix/testing/helpers.py | muthukswamy/avionix | 4463328d8520a10cdcb609805e512f5a9f90ad52 | [
"BSD-3-Clause"
] | null | null | null | avionix/testing/helpers.py | muthukswamy/avionix | 4463328d8520a10cdcb609805e512f5a9f90ad52 | [
"BSD-3-Clause"
] | null | null | null | import re
from subprocess import CalledProcessError
from typing import Any, List, Optional, Tuple
from avionix._process_utils import custom_check_output
def _space_split(output_line: str):
return [
value
for value in re.split(r"(\t| +)", output_line)
if not re.match(r"^\s*$", value)
... | 29.597222 | 84 | 0.627405 | import re
from subprocess import CalledProcessError
from typing import Any, List, Optional, Tuple
from avionix._process_utils import custom_check_output
def _space_split(output_line: str):
return [
value
for value in re.split(r"(\t| +)", output_line)
if not re.match(r"^\s*$", value)
... | true | true |
f741b126d4d0a11bcd1c782c04432ecf12ee3d96 | 2,519 | py | Python | Proyecto1/venv/Lib/site-packages/telegram/dice.py | RicardoVinicioJara/LugaresTusisticos | d92264231c471cecbc17a2279bedb3779424147c | [
"CC-BY-3.0"
] | 1 | 2021-12-27T21:37:04.000Z | 2021-12-27T21:37:04.000Z | Proyecto1/venv/Lib/site-packages/telegram/dice.py | RicardoVinicioJara/LugaresTusisticos | d92264231c471cecbc17a2279bedb3779424147c | [
"CC-BY-3.0"
] | null | null | null | Proyecto1/venv/Lib/site-packages/telegram/dice.py | RicardoVinicioJara/LugaresTusisticos | d92264231c471cecbc17a2279bedb3779424147c | [
"CC-BY-3.0"
] | 1 | 2021-05-23T18:37:37.000Z | 2021-05-23T18:37:37.000Z | #!/usr/bin/env python
# pylint: disable=R0903
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2020
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public L... | 37.597015 | 98 | 0.667328 |
from telegram import TelegramObject
class Dice(TelegramObject):
def __init__(self, value, emoji, **kwargs):
self.value = value
self.emoji = emoji
@classmethod
def de_json(cls, data, bot):
if not data:
return None
return cls(**data)
DICE... | true | true |
f741b19a862036a25420498abb6c38930096315b | 9,213 | py | Python | src/infi/pyutils/lazy.py | jasonjorge/infi.asi | 78a4c34a421102f99b959a659cf7303804627d9b | [
"BSD-3-Clause"
] | 1 | 2022-02-12T20:30:55.000Z | 2022-02-12T20:30:55.000Z | src/infi/pyutils/lazy.py | jasonjorge/infi.asi | 78a4c34a421102f99b959a659cf7303804627d9b | [
"BSD-3-Clause"
] | 5 | 2015-11-08T14:50:42.000Z | 2020-06-23T14:42:33.000Z | src/infi/pyutils/lazy.py | jasonjorge/infi.asi | 78a4c34a421102f99b959a659cf7303804627d9b | [
"BSD-3-Clause"
] | 4 | 2015-02-22T09:06:59.000Z | 2022-02-12T20:30:55.000Z | # Adapted from http://wiki.python.org/moin/PythonDecoratorLibrary#Cached_Properties
import itertools
import time
from .decorators import wraps
from .python_compat import iteritems
from logging import getLogger
from types import MethodType, FunctionType
logger = getLogger(__name__)
class cached_property(object):
"... | 36.41502 | 127 | 0.635189 | import time
from .decorators import wraps
from .python_compat import iteritems
from logging import getLogger
from types import MethodType, FunctionType
logger = getLogger(__name__)
class cached_property(object):
def __init__(self, fget, doc=None):
super(cached_property, self).__init__()
self.fget ... | true | true |
f741b267946788d36428513037138bc95698c844 | 5,606 | py | Python | hw1_release/filters.py | luxufan/CS131_release | e8a92582cfffee3ba6bb43f757bcb520785b6f04 | [
"MIT"
] | null | null | null | hw1_release/filters.py | luxufan/CS131_release | e8a92582cfffee3ba6bb43f757bcb520785b6f04 | [
"MIT"
] | null | null | null | hw1_release/filters.py | luxufan/CS131_release | e8a92582cfffee3ba6bb43f757bcb520785b6f04 | [
"MIT"
] | 2 | 2019-10-08T02:49:26.000Z | 2019-11-10T01:44:42.000Z | """
CS131 - Computer Vision: Foundations and Applications
Assignment 1
Author: Donsuk Lee (donlee90@stanford.edu)
Date created: 07/2017
Last modified: 10/16/2017
Python Version: 3.5+
"""
import numpy as np
def conv_nested(image, kernel):
"""A naive implementation of convolution filter.
This is a naive imple... | 27.082126 | 110 | 0.57492 |
import numpy as np
def conv_nested(image, kernel):
Hi, Wi = image.shape
Hk, Wk = kernel.shape
out = np.zeros((Hi, Wi))
for j in range(Wi):
sum = 0
for ii in range(-(Hk//2), Hk//2 + 1):
for jj in range(-(Wk//2), Wk//2 + 1):
sum += image[i - ... | true | true |
f741b3b043c4ab9fde26389ac48c26c57142a16d | 3,671 | py | Python | tests/packages/run_all.py | kamgha/Nuitka | c4a71f0233dd29e3799c474ccda1d5474d725f20 | [
"Apache-2.0"
] | null | null | null | tests/packages/run_all.py | kamgha/Nuitka | c4a71f0233dd29e3799c474ccda1d5474d725f20 | [
"Apache-2.0"
] | null | null | null | tests/packages/run_all.py | kamgha/Nuitka | c4a71f0233dd29e3799c474ccda1d5474d725f20 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Software where
# it's copied from other people. In these cases, that will normally be
# ... | 29.604839 | 87 | 0.590302 |
# indicated.
#
# 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... | true | true |
f741b3db6306c952f0c22f79112e46521f88000d | 455 | py | Python | examples/jsonrpc/test.py | IronBlood/onion | 43128b03199518d4878074c311ff71ff0018aea8 | [
"Apache-2.0"
] | 1,261 | 2015-01-01T02:06:26.000Z | 2022-03-31T23:36:05.000Z | examples/jsonrpc/test.py | IronBlood/onion | 43128b03199518d4878074c311ff71ff0018aea8 | [
"Apache-2.0"
] | 144 | 2015-01-06T21:01:09.000Z | 2022-03-15T13:08:40.000Z | examples/jsonrpc/test.py | IronBlood/onion | 43128b03199518d4878074c311ff71ff0018aea8 | [
"Apache-2.0"
] | 251 | 2015-01-05T05:14:18.000Z | 2022-03-17T21:39:04.000Z | #!/usr/bin/python
#
# pip install tinyrpc
#
from tinyrpc.protocols.jsonrpc import JSONRPCProtocol
from tinyrpc.transports.http import HttpPostClientTransport
from tinyrpc import RPCClient
rpc_client = RPCClient(
JSONRPCProtocol(),
HttpPostClientTransport('http://localhost:8080/')
)
local = rpc_client.get_pr... | 16.25 | 59 | 0.745055 |
from tinyrpc.protocols.jsonrpc import JSONRPCProtocol
from tinyrpc.transports.http import HttpPostClientTransport
from tinyrpc import RPCClient
rpc_client = RPCClient(
JSONRPCProtocol(),
HttpPostClientTransport('http://localhost:8080/')
)
local = rpc_client.get_proxy()
s=' This is a message '
strip... | false | true |
f741b4b55312954b9aa3047d2cca5788fc30e368 | 83 | py | Python | src/pyasys/contrib/__init__.py | heewoonkim2020/pyasys | ee0e55bbfe1956c7f3cba4c0384b2c6e770658cb | [
"MIT"
] | null | null | null | src/pyasys/contrib/__init__.py | heewoonkim2020/pyasys | ee0e55bbfe1956c7f3cba4c0384b2c6e770658cb | [
"MIT"
] | null | null | null | src/pyasys/contrib/__init__.py | heewoonkim2020/pyasys | ee0e55bbfe1956c7f3cba4c0384b2c6e770658cb | [
"MIT"
] | null | null | null | """
Contrib-util features for Pyasys.
Recommended for advanced developing uses.
""" | 20.75 | 41 | 0.771084 | true | true | |
f741b4c971f016b45985a6944779f4de1943f37b | 18,472 | py | Python | drqa/reader/model.py | Roboy/DrQA | 59c9d3f9b969e00cf9093b67b52463d18fd5775e | [
"BSD-3-Clause"
] | 3 | 2019-03-13T14:03:44.000Z | 2019-09-11T02:30:00.000Z | drqa/reader/model.py | heyLinsir/DrQA | 50d0e49bb77fe0c6e881efb4b6fe2e61d3f92509 | [
"BSD-3-Clause"
] | null | null | null | drqa/reader/model.py | heyLinsir/DrQA | 50d0e49bb77fe0c6e881efb4b6fe2e61d3f92509 | [
"BSD-3-Clause"
] | 2 | 2019-04-18T02:02:01.000Z | 2020-02-02T05:35:17.000Z | #!/usr/bin/env python3
# Copyright 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""DrQA Document Reader model"""
import torch
import torch.optim as optim
import torch.nn.functional as F
impo... | 38.403326 | 80 | 0.550996 |
"""DrQA Document Reader model"""
import torch
import torch.optim as optim
import torch.nn.functional as F
import numpy as np
import logging
import copy
from torch.autograd import Variable
from .config import override_model_args
from .rnn_reader import RnnDocReader
logger = logging.getLogger(__name__)
class D... | false | true |
f741b508a982c997e9cd2785c856edfe094c3c07 | 67,319 | py | Python | src/TulsiGenerator/Scripts/bazel_build.py | maxwellE/tulsi | 2dd98fe970381c67a1fd14df60f9f4fd988505d8 | [
"Apache-2.0"
] | null | null | null | src/TulsiGenerator/Scripts/bazel_build.py | maxwellE/tulsi | 2dd98fe970381c67a1fd14df60f9f4fd988505d8 | [
"Apache-2.0"
] | null | null | null | src/TulsiGenerator/Scripts/bazel_build.py | maxwellE/tulsi | 2dd98fe970381c67a1fd14df60f9f4fd988505d8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2016 The Tulsi Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... | 38.512014 | 80 | 0.65815 |
import atexit
import errno
import fcntl
import hashlib
import inspect
import io
import json
import os
import pipes
import re
import shutil
import signal
import subprocess
import sys
import textwrap
import threading
import time
import zipfile
from apfs_clone_copy import CopyOnWrite
import bazel_build_e... | true | true |
f741b51c8313efd31142306b169695b563c5f2ab | 1,369 | py | Python | delfiSpec/specproc.py | aaryapatil/specdims | acfc644aa06b13c8b34cde984e207b42e948af41 | [
"MIT"
] | 4 | 2021-09-23T12:08:14.000Z | 2022-03-25T05:20:58.000Z | delfiSpec/specproc.py | aaryapatil/specdims | acfc644aa06b13c8b34cde984e207b42e948af41 | [
"MIT"
] | null | null | null | delfiSpec/specproc.py | aaryapatil/specdims | acfc644aa06b13c8b34cde984e207b42e948af41 | [
"MIT"
] | null | null | null | # Import dependencies
import numpy as np
from apogee.spec import continuum
from apogee.tools import bitmask as bm
from .util import get_DR_slice, bitsNotSet
# Future: Define a class for spectra - spectra, error and weight
def process_spectra(spectra_info=None, badcombpixmask=4351, minSNR=50.):
cont_cannon = cont... | 34.225 | 86 | 0.680789 |
import numpy as np
from apogee.spec import continuum
from apogee.tools import bitmask as bm
from .util import get_DR_slice, bitsNotSet
def process_spectra(spectra_info=None, badcombpixmask=4351, minSNR=50.):
cont_cannon = continuum.fit(spectra_info[:, 0], spectra_info[:, 1], type='cannon')
spectra_info[:,... | true | true |
f741b56dcc418f4b0194578b3d02784e86a53fe0 | 623 | py | Python | imagepy/tools/Measure/setting_tol.py | Pad0y/imagepy | 23f41b64ade02f94b566b0d23a4b6459c1a1578d | [
"BSD-4-Clause"
] | null | null | null | imagepy/tools/Measure/setting_tol.py | Pad0y/imagepy | 23f41b64ade02f94b566b0d23a4b6459c1a1578d | [
"BSD-4-Clause"
] | null | null | null | imagepy/tools/Measure/setting_tol.py | Pad0y/imagepy | 23f41b64ade02f94b566b0d23a4b6459c1a1578d | [
"BSD-4-Clause"
] | null | null | null | from sciapp.action import Measure
from sciapp.action import Free
from imagepy.app import ConfigManager
class Plugin(Free):
title = "Measure Setting"
para = Measure.default.copy()
view = [
("color", "color", "line", "color"),
("color", "fcolor", "face", "color"),
("color", "tcolor",... | 28.318182 | 50 | 0.540931 | from sciapp.action import Measure
from sciapp.action import Free
from imagepy.app import ConfigManager
class Plugin(Free):
title = "Measure Setting"
para = Measure.default.copy()
view = [
("color", "color", "line", "color"),
("color", "fcolor", "face", "color"),
("color", "tcolor",... | true | true |
f741b6c629c2aa47e414eb1f19acccbee739587e | 33,134 | py | Python | OpenGLWrapper_JE/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | 40 | 2020-07-11T10:07:51.000Z | 2021-12-11T17:09:20.000Z | OpenGLWrapper_JE/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | 18 | 2020-07-20T18:54:31.000Z | 2021-11-04T13:14:28.000Z | OpenGLWrapper_JE/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | 37 | 2020-07-09T23:12:30.000Z | 2022-03-16T11:15:58.000Z | """
SecureTranport support for urllib3 via ctypes.
This makes platform-native TLS available to urllib3 users on macOS without the
use of a compiler. This is an important feature because the Python Package
Index is moving to become a TLSv1.2-or-higher server, and the default OpenSSL
that ships with macOS is not c... | 38.527907 | 87 | 0.643146 | from __future__ import absolute_import
import contextlib
import ctypes
import errno
import os.path
import shutil
import socket
import ssl
import threading
import weakref
from .. import util
from ._securetransport.bindings import Security, SecurityConst, CoreFoundation
from ._securetransport.low_level im... | true | true |
f741b77bbffd0226b1db8bc25f06b2a26cd0e1fa | 1,556 | py | Python | repos/system_upgrade/common/actors/dnftransactioncheck/actor.py | tmds/leapp-repository | 7c9ea115a68530eb25f5c23d3fcadd60c501bf78 | [
"Apache-2.0"
] | null | null | null | repos/system_upgrade/common/actors/dnftransactioncheck/actor.py | tmds/leapp-repository | 7c9ea115a68530eb25f5c23d3fcadd60c501bf78 | [
"Apache-2.0"
] | 1 | 2022-03-07T15:34:11.000Z | 2022-03-07T15:35:15.000Z | repos/system_upgrade/common/actors/dnftransactioncheck/actor.py | tmds/leapp-repository | 7c9ea115a68530eb25f5c23d3fcadd60c501bf78 | [
"Apache-2.0"
] | null | null | null | from leapp.actors import Actor
from leapp.libraries.common import dnfplugin
from leapp.models import (
DNFPluginTask,
DNFWorkaround,
FilteredRpmTransactionTasks,
StorageInfo,
TargetUserSpaceInfo,
UsedTargetRepositories,
XFSPresence
)
from leapp.tags import IPUWorkflowTag, TargetTransactionCh... | 33.826087 | 118 | 0.71401 | from leapp.actors import Actor
from leapp.libraries.common import dnfplugin
from leapp.models import (
DNFPluginTask,
DNFWorkaround,
FilteredRpmTransactionTasks,
StorageInfo,
TargetUserSpaceInfo,
UsedTargetRepositories,
XFSPresence
)
from leapp.tags import IPUWorkflowTag, TargetTransactionCh... | true | true |
f741b8d3d82d7006295eb1647ddbe060ec5bc2fe | 770 | py | Python | tir/technologies/core/enumerations.py | vinicius-fragazi/tir | 756faa19902ae4d19b6cb3df663beda9512c07bb | [
"MIT"
] | 55 | 2018-09-12T22:01:42.000Z | 2022-01-27T19:16:56.000Z | tir/technologies/core/enumerations.py | vinicius-fragazi/tir | 756faa19902ae4d19b6cb3df663beda9512c07bb | [
"MIT"
] | 44 | 2018-09-17T13:50:42.000Z | 2021-08-31T17:54:32.000Z | tir/technologies/core/enumerations.py | vinicius-fragazi/tir | 756faa19902ae4d19b6cb3df663beda9512c07bb | [
"MIT"
] | 55 | 2018-09-13T01:44:42.000Z | 2022-03-08T21:37:35.000Z | from enum import Enum
class MessageType(Enum):
'''
Enumeration that represents the standard messages that are emitted inside log file.
CORRECT = 1
INCORRECT = 2
DISABLED = 3
ASSERTERROR = 4
'''
CORRECT = 1
INCORRECT = 2
DISABLED = 3
ASSERTERROR = 4
class ScrapType(Enum)... | 14.807692 | 87 | 0.587013 | from enum import Enum
class MessageType(Enum):
CORRECT = 1
INCORRECT = 2
DISABLED = 3
ASSERTERROR = 4
class ScrapType(Enum):
TEXT = 1
CSS_SELECTOR = 2
MIXED = 3
SCRIPT = 4
XPATH = 5
class ClickType(Enum):
JS = 1
SELENIUM = 2
ACTIONCHAINS = 3 | true | true |
f741b95a8a2d44685ea6d1e73162967adf5bd58a | 12,370 | py | Python | exp_gqa/main.py | yhCyan/graph-tensor-propagation | b216fb24c5b9ea21d7b338ac24b272b0f346fcc3 | [
"BSD-2-Clause"
] | null | null | null | exp_gqa/main.py | yhCyan/graph-tensor-propagation | b216fb24c5b9ea21d7b338ac24b272b0f346fcc3 | [
"BSD-2-Clause"
] | null | null | null | exp_gqa/main.py | yhCyan/graph-tensor-propagation | b216fb24c5b9ea21d7b338ac24b272b0f346fcc3 | [
"BSD-2-Clause"
] | null | null | null | import os
import json
import torch
import sys
import time
import random
import numpy as np
from tqdm import tqdm, trange
import torch.multiprocessing as mp
import torch.distributed as dist
from torch.utils.tensorboard import SummaryWriter
from apex.parallel import DistributedDataParallel as DDP
from apex import amp
s... | 39.022082 | 139 | 0.636459 | import os
import json
import torch
import sys
import time
import random
import numpy as np
from tqdm import tqdm, trange
import torch.multiprocessing as mp
import torch.distributed as dist
from torch.utils.tensorboard import SummaryWriter
from apex.parallel import DistributedDataParallel as DDP
from apex import amp
s... | true | true |
f741ba1a1add4c5de884efb90b81ee7dc7817ee1 | 917 | py | Python | scripts/missing_taskinstance.py | systori/systori | e309c63e735079ff6032fdaf1db354ec872b28b1 | [
"BSD-3-Clause"
] | 12 | 2018-01-30T00:44:06.000Z | 2020-07-13T05:20:48.000Z | scripts/missing_taskinstance.py | systori/systori | e309c63e735079ff6032fdaf1db354ec872b28b1 | [
"BSD-3-Clause"
] | 36 | 2018-03-06T17:49:50.000Z | 2020-06-23T19:26:00.000Z | scripts/missing_taskinstance.py | systori/systori | e309c63e735079ff6032fdaf1db354ec872b28b1 | [
"BSD-3-Clause"
] | 3 | 2018-08-03T07:03:09.000Z | 2020-07-09T20:21:10.000Z | import os
import re
import unicodedata
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "systori.settings")
import django
django.setup()
from systori.apps.company.models import Company
from systori.apps.task.models import *
from systori.apps.project.models import *
c = Company.objects.get(schema=input("Company Schem... | 33.962963 | 83 | 0.656489 | import os
import re
import unicodedata
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "systori.settings")
import django
django.setup()
from systori.apps.company.models import Company
from systori.apps.task.models import *
from systori.apps.project.models import *
c = Company.objects.get(schema=input("Company Schem... | true | true |
f741ba7f0a2829bac8e4b22d573b6361e8027928 | 3,247 | py | Python | huaweicloud-sdk-ocr/huaweicloudsdkocr/v1/model/recognize_transportation_license_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-ocr/huaweicloudsdkocr/v1/model/recognize_transportation_license_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-ocr/huaweicloudsdkocr/v1/model/recognize_transportation_license_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class RecognizeTransportationLicenseResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
... | 28.734513 | 89 | 0.583 |
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class RecognizeTransportationLicenseResponse(SdkResponse):
sensitive_list = []
openapi_types = {
'result': 'TransportationLicenseResult'
}... | true | true |
f741ba8c9fc0ecb9fb8440bce77b98a81245f12f | 7,752 | py | Python | packages/cli/odahuflow/cli/parsers/toolchain_integration.py | odahu/odahuflow | 58c3220a266a61bb893cf79c4b994569e3445097 | [
"ECL-2.0",
"Apache-2.0"
] | 12 | 2020-10-13T15:39:52.000Z | 2021-10-11T17:13:42.000Z | packages/cli/odahuflow/cli/parsers/toolchain_integration.py | odahu/odahuflow | 58c3220a266a61bb893cf79c4b994569e3445097 | [
"ECL-2.0",
"Apache-2.0"
] | 475 | 2019-11-18T12:40:47.000Z | 2022-03-29T21:17:38.000Z | packages/cli/odahuflow/cli/parsers/toolchain_integration.py | odahu/odahuflow | 58c3220a266a61bb893cf79c4b994569e3445097 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2020-02-25T11:26:10.000Z | 2021-03-10T12:01:00.000Z | #
# Copyright 2019 EPAM Systems
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 45.069767 | 116 | 0.739164 |
import http
import click
from odahuflow.cli.utils import click_utils
from odahuflow.cli.utils.click_utils import auth_options
from odahuflow.cli.utils.client import pass_obj
from odahuflow.cli.utils.error_handler import IGNORE_NOT_FOUND_ERROR_MESSAGE, \
check_id_or_file_params_present
from odahuflo... | true | true |
f741bc507147e60f884db547bc2173ea30e6ce0c | 3,260 | py | Python | mycity/mycity/test/unit_tests/test_gis_utils.py | EndyPremier/voiceapp311 | 168cf1665bd9a294823f82373e65c6c1d22b8831 | [
"MIT"
] | 46 | 2017-09-23T15:40:10.000Z | 2021-03-08T21:51:48.000Z | mycity/mycity/test/unit_tests/test_gis_utils.py | EndyPremier/voiceapp311 | 168cf1665bd9a294823f82373e65c6c1d22b8831 | [
"MIT"
] | 243 | 2017-10-04T01:04:41.000Z | 2022-03-20T16:19:24.000Z | mycity/mycity/test/unit_tests/test_gis_utils.py | EndyPremier/voiceapp311 | 168cf1665bd9a294823f82373e65c6c1d22b8831 | [
"MIT"
] | 53 | 2017-09-23T15:41:27.000Z | 2020-12-17T22:43:45.000Z | import unittest.mock as mock
import mycity.test.test_constants as test_constants
import mycity.test.unit_tests.base as base
import mycity.utilities.gis_utils as gis_utils
class GISUtilitiesTestCase(base.BaseTestCase):
def test_get_dest_addresses_from_features(self):
to_test = \
gis_utils._get... | 45.277778 | 84 | 0.553067 | import unittest.mock as mock
import mycity.test.test_constants as test_constants
import mycity.test.unit_tests.base as base
import mycity.utilities.gis_utils as gis_utils
class GISUtilitiesTestCase(base.BaseTestCase):
def test_get_dest_addresses_from_features(self):
to_test = \
gis_utils._get... | true | true |
f741bd38463f30a956b3a245afa7f64dd9c129ec | 2,941 | py | Python | src/imageboard/models/post.py | hohner36/hexchan-engine | 8edf155e8fe64936dfe428a6e9bac69705934b1f | [
"MIT"
] | 2 | 2021-04-16T10:11:18.000Z | 2022-03-15T15:16:14.000Z | src/imageboard/models/post.py | hohner36/hexchan-engine | 8edf155e8fe64936dfe428a6e9bac69705934b1f | [
"MIT"
] | 2 | 2019-09-02T19:12:07.000Z | 2019-11-05T22:32:04.000Z | src/imageboard/models/post.py | hohner36/hexchan-engine | 8edf155e8fe64936dfe428a6e9bac69705934b1f | [
"MIT"
] | 2 | 2019-09-02T18:37:25.000Z | 2022-02-20T19:19:40.000Z | from django.db import models
from django.conf import settings
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from hexchan import config
class Post(models.Model):
hid = models.IntegerField(
_('HID'),
editable=False,
db_index=True
)
thread = ... | 20.711268 | 86 | 0.558313 | from django.db import models
from django.conf import settings
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from hexchan import config
class Post(models.Model):
hid = models.IntegerField(
_('HID'),
editable=False,
db_index=True
)
thread = ... | true | true |
f741be91a7087d8b4ddb92b7c0f6ea43266efdf4 | 187 | py | Python | thirvusoft/thirvusoft/doctype/ts_payroll/ts_payroll.py | SaraneshThirvu/Script_Report | 5af8f4d3dc32ead2b124f10c55040d49a21ebb5d | [
"MIT"
] | null | null | null | thirvusoft/thirvusoft/doctype/ts_payroll/ts_payroll.py | SaraneshThirvu/Script_Report | 5af8f4d3dc32ead2b124f10c55040d49a21ebb5d | [
"MIT"
] | null | null | null | thirvusoft/thirvusoft/doctype/ts_payroll/ts_payroll.py | SaraneshThirvu/Script_Report | 5af8f4d3dc32ead2b124f10c55040d49a21ebb5d | [
"MIT"
] | null | null | null | # Copyright (c) 2021, TS and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class TS_Payroll(Document):
pass
| 20.777778 | 49 | 0.786096 |
from frappe.model.document import Document
class TS_Payroll(Document):
pass
| true | true |
f741bf18e2b60aca3fb332c536962bd016be881a | 2,867 | py | Python | testing/trigger_scripts/base_test_triggerer_unittest.py | Ron423c/chromium | 2edf7b980065b648f8b2a6e52193d83832fe36b7 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 6 | 2020-12-22T05:48:31.000Z | 2022-02-08T19:49:49.000Z | testing/trigger_scripts/base_test_triggerer_unittest.py | Ron423c/chromium | 2edf7b980065b648f8b2a6e52193d83832fe36b7 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 4 | 2020-05-22T18:36:43.000Z | 2021-05-19T10:20:23.000Z | extensions/testing/trigger_scripts/base_test_triggerer_unittest.py | blockspacer/chromium_base_conan | b4749433cf34f54d2edff52e2f0465fec8cb9bad | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2019-12-06T11:48:16.000Z | 2021-09-16T04:44:47.000Z | #!/usr/bin/env vpython
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tests for base_device_trigger.py."""
import argparse
import json
import unittest
import mock
from pyfakefs import fake_filesyste... | 29.864583 | 77 | 0.599581 |
import argparse
import json
import unittest
import mock
from pyfakefs import fake_filesystem_unittest
import base_test_triggerer
class UnitTest(fake_filesystem_unittest.TestCase):
def setUp(self):
self.setUpPyfakefs()
def test_convert_to_go_swarming_args(self):
args = [
'--swarming', 'x.... | true | true |
f741bf5b1ab789f3f69dba4394b6c567b8432545 | 59 | py | Python | src/neuralkg/utils/__init__.py | zjukg/NeuralKG | 9fe97c29496ed08bc72c76e4dd71e72cbfbe5afa | [
"Apache-2.0"
] | 52 | 2022-01-19T09:08:07.000Z | 2022-03-31T07:02:17.000Z | src/neuralkg/utils/__init__.py | zjukg/NeuralKG | 9fe97c29496ed08bc72c76e4dd71e72cbfbe5afa | [
"Apache-2.0"
] | 2 | 2022-03-08T20:47:38.000Z | 2022-03-18T09:52:33.000Z | src/neuralkg/utils/__init__.py | zjukg/NeuralKG | 9fe97c29496ed08bc72c76e4dd71e72cbfbe5afa | [
"Apache-2.0"
] | 10 | 2022-02-28T07:54:14.000Z | 2022-03-23T14:06:33.000Z | from .setup_parser import setup_parser
from .tools import * | 29.5 | 38 | 0.830508 | from .setup_parser import setup_parser
from .tools import * | true | true |
f741bf641d959301c7d3beb9f3df745811545195 | 2,288 | py | Python | task3_doc2vec_svm.py | tomelf/cnit-623 | edf25f0b216b2480f7b651d3b94c1377dff721c0 | [
"MIT"
] | 4 | 2020-08-28T21:33:48.000Z | 2021-01-16T22:43:36.000Z | task3_doc2vec_svm.py | tomelf/cnit-623 | edf25f0b216b2480f7b651d3b94c1377dff721c0 | [
"MIT"
] | null | null | null | task3_doc2vec_svm.py | tomelf/cnit-623 | edf25f0b216b2480f7b651d3b94c1377dff721c0 | [
"MIT"
] | 4 | 2021-01-16T22:42:52.000Z | 2021-01-16T22:43:45.000Z | import data_loader
import numpy as np
import pandas as pd
import re
import os.path
from itertools import product
from string import ascii_lowercase
from sklearn.pipeline import Pipeline, FeatureUnion
from sklearn.decomposition import PCA, TruncatedSVD
from sklearn.metrics import roc_auc_score, accuracy_score, classif... | 40.140351 | 106 | 0.741259 | import data_loader
import numpy as np
import pandas as pd
import re
import os.path
from itertools import product
from string import ascii_lowercase
from sklearn.pipeline import Pipeline, FeatureUnion
from sklearn.decomposition import PCA, TruncatedSVD
from sklearn.metrics import roc_auc_score, accuracy_score, classif... | true | true |
f741bf7256c2d7d9c40f6a1a686af24b1cd1b716 | 2,918 | py | Python | openstack_dashboard/test/test_data/trove_data.py | spandanb/horizon | 4a96f2e2a2b087508c369e0bea891a29829a673d | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/test/test_data/trove_data.py | spandanb/horizon | 4a96f2e2a2b087508c369e0bea891a29829a673d | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/test/test_data/trove_data.py | spandanb/horizon | 4a96f2e2a2b087508c369e0bea891a29829a673d | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Rackspace Hosting.
#
# 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... | 29.474747 | 78 | 0.626799 |
from troveclient.v1 import backups
from troveclient.v1 import instances
from openstack_dashboard.test.test_data import utils
DATABASE_DATA_ONE = {
"status": "ACTIVE",
"updated": "2013-08-12T22:00:09",
"name": "Test Database",
"links": [],
"created": "2013-08-12T22:00:03",
"ip": ... | true | true |
f741c0813c7d76913a35d694a43a5d4e70a0526f | 2,009 | py | Python | keylime/cmd_exec.py | ansasaki/keylime | 6aeb105975e8f2b3e9c83417dcf69b25dc2d69e4 | [
"Apache-2.0"
] | null | null | null | keylime/cmd_exec.py | ansasaki/keylime | 6aeb105975e8f2b3e9c83417dcf69b25dc2d69e4 | [
"Apache-2.0"
] | null | null | null | keylime/cmd_exec.py | ansasaki/keylime | 6aeb105975e8f2b3e9c83417dcf69b25dc2d69e4 | [
"Apache-2.0"
] | null | null | null | '''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
'''
import os
import subprocess
import time
EXIT_SUCESS = 0
def _execute(cmd, env=None, **kwargs):
proc = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, **kw... | 27.902778 | 84 | 0.642111 |
import os
import subprocess
import time
EXIT_SUCESS = 0
def _execute(cmd, env=None, **kwargs):
proc = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, **kwargs)
out, err = proc.communicate()
code = proc.returncode
return out, err, code
def... | true | true |
f741c0980a7cde085e267316044af0b54f0224f6 | 4,564 | py | Python | acapy_client/models/w3c_credentials_list_request.py | dbluhm/acapy-client | d92ef607ba2ff1152ec15429f2edb20976991424 | [
"Apache-2.0"
] | 4 | 2021-08-05T09:20:34.000Z | 2021-08-08T19:37:29.000Z | acapy_client/models/w3c_credentials_list_request.py | dbluhm/acapy-client | d92ef607ba2ff1152ec15429f2edb20976991424 | [
"Apache-2.0"
] | null | null | null | acapy_client/models/w3c_credentials_list_request.py | dbluhm/acapy-client | d92ef607ba2ff1152ec15429f2edb20976991424 | [
"Apache-2.0"
] | 2 | 2021-08-12T18:18:45.000Z | 2021-08-14T13:22:28.000Z | from typing import Any, Dict, List, Type, TypeVar, Union, cast
import attr
from ..models.w3c_credentials_list_request_tag_query import W3CCredentialsListRequestTagQuery
from ..types import UNSET, Unset
T = TypeVar("T", bound="W3CCredentialsListRequest")
@attr.s(auto_attribs=True)
class W3CCredentialsListRequest:
... | 34.059701 | 93 | 0.634531 | from typing import Any, Dict, List, Type, TypeVar, Union, cast
import attr
from ..models.w3c_credentials_list_request_tag_query import W3CCredentialsListRequestTagQuery
from ..types import UNSET, Unset
T = TypeVar("T", bound="W3CCredentialsListRequest")
@attr.s(auto_attribs=True)
class W3CCredentialsListRequest:
... | true | true |
f741c0db78edd42c5fe5293e199ee5df2b4f5ceb | 705 | py | Python | trails/feeds/socksproxy.py | vurtne/maltrail | 5ef8a3c6dba07d5d3b697c35412de95e164c3b9b | [
"MIT"
] | null | null | null | trails/feeds/socksproxy.py | vurtne/maltrail | 5ef8a3c6dba07d5d3b697c35412de95e164c3b9b | [
"MIT"
] | null | null | null | trails/feeds/socksproxy.py | vurtne/maltrail | 5ef8a3c6dba07d5d3b697c35412de95e164c3b9b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Copyright (c) 2014-2019 Miroslav Stampar (@stamparm)
See the file 'LICENSE' for copying permission
"""
from core.common import retrieve_content
__url__ = "https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/socks_proxy_7d.ipset"
__check__ = "socks_proxy_7d"
__info__ = "proxy (... | 26.111111 | 98 | 0.665248 |
from core.common import retrieve_content
__url__ = "https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/socks_proxy_7d.ipset"
__check__ = "socks_proxy_7d"
__info__ = "proxy (suspicious)"
__reference__ = "socks-proxy.net"
def fetch():
retval = {}
content = retrieve_content(__url__)
if __c... | true | true |
f741c0f5ff9e40c057b436c9563746fc83e796f9 | 2,686 | py | Python | noxfile.py | amanchokshi/radio-dreams-v1 | 9371b9600a77f2d519f1815412f85201807703a3 | [
"MIT"
] | 1 | 2021-07-07T16:05:09.000Z | 2021-07-07T16:05:09.000Z | noxfile.py | amanchokshi/radio-dreams-v1 | 9371b9600a77f2d519f1815412f85201807703a3 | [
"MIT"
] | null | null | null | noxfile.py | amanchokshi/radio-dreams-v1 | 9371b9600a77f2d519f1815412f85201807703a3 | [
"MIT"
] | 1 | 2021-07-07T16:05:13.000Z | 2021-07-07T16:05:13.000Z | """Nox sessions."""
import tempfile
import nox
package = "radio_dreams"
nox.options.sessions = "lint", "tests"
locations = "src", "tests", "noxfile.py", "docs/conf.py"
def install_with_constraints(session, *args, **kwargs):
"""Install packages constrained by Poetry's lock file.
This function is a wrapper... | 29.195652 | 77 | 0.643336 |
import tempfile
import nox
package = "radio_dreams"
nox.options.sessions = "lint", "tests"
locations = "src", "tests", "noxfile.py", "docs/conf.py"
def install_with_constraints(session, *args, **kwargs):
with tempfile.NamedTemporaryFile() as requirements:
session.run(
"poetry",
... | true | true |
f741c1c95814209a6c7484dca1036f8f7429f208 | 5,378 | py | Python | gazoo_device/auxiliary_devices/efr32_pigweed_lighting.py | google/gazoo-device | f333b386f5993c8d4c9e12c89ebb620a0c4f5506 | [
"Apache-2.0"
] | 14 | 2020-11-05T23:23:32.000Z | 2022-03-01T18:59:29.000Z | gazoo_device/auxiliary_devices/efr32_pigweed_lighting.py | google/gazoo-device | f333b386f5993c8d4c9e12c89ebb620a0c4f5506 | [
"Apache-2.0"
] | null | null | null | gazoo_device/auxiliary_devices/efr32_pigweed_lighting.py | google/gazoo-device | f333b386f5993c8d4c9e12c89ebb620a0c4f5506 | [
"Apache-2.0"
] | 5 | 2021-05-20T22:52:51.000Z | 2022-02-21T08:46:21.000Z | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 39.837037 | 118 | 0.734288 |
from gazoo_device import decorators
from gazoo_device import detect_criteria
from gazoo_device import gdm_logger
from gazoo_device.base_classes import silabs_efr32_device
from gazoo_device.capabilities import pwrpc_button_default
from gazoo_device.capabilities import pwrpc_common_default
from gazoo_device... | true | true |
f741c1f30a6166e56d63d1ac3997ffaf6925be2f | 8,702 | py | Python | L04_Task_1.py | Alibek80/Algorithms-Python-Base | 3821e63f29a6c49c122a5fd1d168f8e77107ba0a | [
"Apache-2.0"
] | null | null | null | L04_Task_1.py | Alibek80/Algorithms-Python-Base | 3821e63f29a6c49c122a5fd1d168f8e77107ba0a | [
"Apache-2.0"
] | null | null | null | L04_Task_1.py | Alibek80/Algorithms-Python-Base | 3821e63f29a6c49c122a5fd1d168f8e77107ba0a | [
"Apache-2.0"
] | null | null | null | # Проанализировать скорость и сложность одного любого алгоритма,
# разработанных в рамках домашнего задания первых трех уроков.
# В массиве случайных целых чисел поменять местами минимальный и максимальный элементы.
import random
import cProfile
def generate_array(size, min_item, max_item):
return [random.randi... | 53.716049 | 98 | 0.574581 |
import random
import cProfile
def generate_array(size, min_item, max_item):
return [random.randint(min_item, max_item) for _ in range(size)]
def swap_min_max_1(size):
array = generate_array(size, 0, 100)
min_val = array[0]
min_idx = 0
max_val = array[0]
max_idx = 0
for i in range(... | true | true |
f741c30ef8b3474e2b74fb44fc7af3dd7eea3dc8 | 115,202 | py | Python | sympy/core/function.py | MiguelAMLucero/sympy | f7b590d22262b4f9728b60e51c31df237df22e35 | [
"BSD-3-Clause"
] | null | null | null | sympy/core/function.py | MiguelAMLucero/sympy | f7b590d22262b4f9728b60e51c31df237df22e35 | [
"BSD-3-Clause"
] | null | null | null | sympy/core/function.py | MiguelAMLucero/sympy | f7b590d22262b4f9728b60e51c31df237df22e35 | [
"BSD-3-Clause"
] | null | null | null | """
There are three types of functions implemented in SymPy:
1) defined functions (in the sense that they can be evaluated) like
exp or sin; they have a name and a body:
f = exp
2) undefined function which have a name but no body. Undefined
functions can be defined using a Function cla... | 34.144043 | 165 | 0.559843 |
from typing import Any, Dict as tDict, Optional, Set as tSet, Tuple as tTuple, Union as tUnion
from collections.abc import Iterable
from .add import Add
from .assumptions import ManagedProperties
from .basic import Basic, _atomic
from .cache import cacheit
from .containers import Tuple, Dict
from .decorators import _... | true | true |
f741c32ce1b8a1770df5875481539ecee269fb04 | 2,486 | py | Python | old/SchwarzschildRadius1/console.py | hydrius/schwarzschild-radius | d7b80baaa31b4cc8a9144d2fba7d130811e46d8d | [
"MIT"
] | null | null | null | old/SchwarzschildRadius1/console.py | hydrius/schwarzschild-radius | d7b80baaa31b4cc8a9144d2fba7d130811e46d8d | [
"MIT"
] | null | null | null | old/SchwarzschildRadius1/console.py | hydrius/schwarzschild-radius | d7b80baaa31b4cc8a9144d2fba7d130811e46d8d | [
"MIT"
] | null | null | null | from buildings import buildings
class Console:
"""
The console is merely the game logic. Here includes all main functions
including moving, building, the queue handler and perhaps notifications*?
*Although notifications will need another class
- learn about thread safety
- just m... | 27.932584 | 94 | 0.565969 | from buildings import buildings
class Console:
"""
The console is merely the game logic. Here includes all main functions
including moving, building, the queue handler and perhaps notifications*?
*Although notifications will need another class
- learn about thread safety
- just m... | false | true |
f741c3830af3558d7a329cb0a5ab777dc46ceb79 | 627 | py | Python | Temperature Scale Converter/temperature_scale_converter.py | lachenlama/ScriptAllTheThings | a738eb069802a596c5212d81c5f401965fc92851 | [
"MIT"
] | null | null | null | Temperature Scale Converter/temperature_scale_converter.py | lachenlama/ScriptAllTheThings | a738eb069802a596c5212d81c5f401965fc92851 | [
"MIT"
] | null | null | null | Temperature Scale Converter/temperature_scale_converter.py | lachenlama/ScriptAllTheThings | a738eb069802a596c5212d81c5f401965fc92851 | [
"MIT"
] | null | null | null | """
Temperature Scale Converter
- Converts celsius sclae to fahrenheit and vice-versa
Author : (Niyoj Oli)[https://github.com/niyoj]
Date : 24/09/21
"""
temp = input("Input the temperature you would like to convert? (e.g., 45F, 102C etc.) : ")
degree = int(temp[:-1])
i_convention = temp[-1]
if i_convention.upper() =... | 28.5 | 91 | 0.665072 |
temp = input("Input the temperature you would like to convert? (e.g., 45F, 102C etc.) : ")
degree = int(temp[:-1])
i_convention = temp[-1]
if i_convention.upper() == "C":
result = int(round((9 * degree) / 5 + 32))
o_convention = "Fahrenheit"
elif i_convention.upper() == "F":
result = int(round((degree - 32) * ... | true | true |
f741c3e194397df6f8160a66f4dd58e435ff01b7 | 2,158 | py | Python | mergify_engine/tests/functional/actions/test_rebase.py | oharboe/mergify-engine | 70785b1b1d9b2360f7a41c6d7f560e39d9ec4905 | [
"Apache-2.0"
] | null | null | null | mergify_engine/tests/functional/actions/test_rebase.py | oharboe/mergify-engine | 70785b1b1d9b2360f7a41c6d7f560e39d9ec4905 | [
"Apache-2.0"
] | 24 | 2022-02-14T08:36:56.000Z | 2022-03-31T07:35:47.000Z | mergify_engine/tests/functional/actions/test_rebase.py | oharboe/mergify-engine | 70785b1b1d9b2360f7a41c6d7f560e39d9ec4905 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright © 2021 Mergify SAS
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 34.253968 | 85 | 0.644115 |
from unittest import mock
import yaml
from mergify_engine.tests.functional import base
class TestRebaseAction(base.FunctionalTestBase):
async def _do_test_rebase(self):
rules = {
"pull_request_rules": [
{
"name": "rebase",
... | true | true |
f741c6261b18f3fff261e4f49dcef637ddba1774 | 119 | py | Python | cobyqa/linalg/__init__.py | ragonneau/cobyqa | 06c598ed0e3a9ccd030568a677175fdfddbf3821 | [
"BSD-3-Clause"
] | 4 | 2021-11-11T08:38:56.000Z | 2022-03-09T05:44:08.000Z | cobyqa/linalg/__init__.py | ragonneau/cobyqa | 06c598ed0e3a9ccd030568a677175fdfddbf3821 | [
"BSD-3-Clause"
] | 1 | 2021-11-11T00:27:37.000Z | 2021-11-11T00:27:37.000Z | cobyqa/linalg/__init__.py | ragonneau/cobyqa | 06c598ed0e3a9ccd030568a677175fdfddbf3821 | [
"BSD-3-Clause"
] | null | null | null | from .main import bvcs, bvlag, bvtcg, cpqp, lctcg, nnls
__all__ = ['bvcs', 'bvlag', 'bvtcg', 'cpqp', 'lctcg', 'nnls']
| 29.75 | 61 | 0.630252 | from .main import bvcs, bvlag, bvtcg, cpqp, lctcg, nnls
__all__ = ['bvcs', 'bvlag', 'bvtcg', 'cpqp', 'lctcg', 'nnls']
| true | true |
f741c6459bdc3ea082e71324bee55d402c52773d | 3,598 | py | Python | wifisky-master/wifisky.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 50 | 2019-08-19T00:28:30.000Z | 2022-03-26T15:02:52.000Z | wifisky-master/wifisky.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | wifisky-master/wifisky.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 22 | 2019-09-09T17:15:39.000Z | 2022-03-02T17:44:03.000Z | import os
import sys
import subprocess
from os import system
from time import sleep
follow = """
{+}-- https://www.facebook.com/dzmanisso
{+}-- https://twitter.com/ManissoDz
{+}-- https://github.com/Manisso
{+}-- https://www.linkedin.com/in/Manisso
{+}-- https://www.instagram.com/man.i.s/
"""
#Wash is a utility for i... | 32.414414 | 159 | 0.613674 | import os
import sys
import subprocess
from os import system
from time import sleep
follow = """
{+}-- https://www.facebook.com/dzmanisso
{+}-- https://twitter.com/ManissoDz
{+}-- https://github.com/Manisso
{+}-- https://www.linkedin.com/in/Manisso
{+}-- https://www.instagram.com/man.i.s/
"""
033[93m ... | false | true |
f741ca3c5acb4ed8b79563eab78eb6a7230ea498 | 13,684 | py | Python | vendor/github.com/youtube/vitess/test/vtgate_buffer.py | GoLandr/NrogBT | 0dfcf87718954c730f44b8cf6c661082d47396d0 | [
"MIT"
] | 1 | 2017-06-29T04:57:43.000Z | 2017-06-29T04:57:43.000Z | vendor/github.com/youtube/vitess/test/vtgate_buffer.py | GoLandr/NrogBT | 0dfcf87718954c730f44b8cf6c661082d47396d0 | [
"MIT"
] | null | null | null | vendor/github.com/youtube/vitess/test/vtgate_buffer.py | GoLandr/NrogBT | 0dfcf87718954c730f44b8cf6c661082d47396d0 | [
"MIT"
] | 3 | 2017-04-03T21:07:17.000Z | 2020-03-04T04:59:05.000Z | #!/usr/bin/env python
#
# Copyright 2016 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
"""Test the vtgate master buffer.
During a master failover, vtgate should automatically buffer (stall) requests
for a configured time and retr... | 34.643038 | 80 | 0.665303 |
import logging
import Queue
import random
import threading
import time
import unittest
import environment
import tablet
import utils
from mysql_flavor import mysql_flavor
KEYSPACE = 'ks1'
SHARD = '0'
SCHEMA = '''CREATE TABLE buffer(
id BIGINT NOT NULL,
msg VARCHAR(64) NOT NULL,
PRIMARY KEY (id)
) ENGINE... | true | true |
f741cb9f2f7b4b19311a89635be888eae55ba82a | 4,279 | py | Python | python/rover_publisher.py | srmainwaring/python-ignition | 720f2e6d8e675ed7e10488caf11ef7e93e519d58 | [
"Apache-2.0"
] | 3 | 2022-01-05T19:25:42.000Z | 2022-02-28T02:51:28.000Z | python/rover_publisher.py | srmainwaring/python-ignition | 720f2e6d8e675ed7e10488caf11ef7e93e519d58 | [
"Apache-2.0"
] | 4 | 2022-01-10T16:54:30.000Z | 2022-01-11T15:38:41.000Z | python/rover_publisher.py | srmainwaring/python-ignition | 720f2e6d8e675ed7e10488caf11ef7e93e519d58 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (C) 2022 Rhys Mainwaring
#
# 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 applicabl... | 29.510345 | 78 | 0.597102 |
import Rotation as Rotation
import math
import time
from ignition.msgs.header_pb2 import Header
from ignition.msgs.pose_pb2 import Pose
from ignition.msgs.quaternion_pb2 import Quaternion
from ignition.msgs.time_pb2 import Time
from ignition.msgs.twist_pb2 import Twist
from ignition.msgs.vector3d_pb2 import V... | true | true |
f741cc189e30b4e109e532d5f828572dec3c5913 | 10,391 | py | Python | geoglam/anomaly_detection/main.py | edisonguo/ml_geoglam | ba18926931f95965308af9059ca114edf298b2f8 | [
"Apache-2.0"
] | null | null | null | geoglam/anomaly_detection/main.py | edisonguo/ml_geoglam | ba18926931f95965308af9059ca114edf298b2f8 | [
"Apache-2.0"
] | null | null | null | geoglam/anomaly_detection/main.py | edisonguo/ml_geoglam | ba18926931f95965308af9059ca114edf298b2f8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 National Computational Infrastructure(NCI).
# 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
#
# Unl... | 42.412245 | 192 | 0.635165 |
import numpy as np
from osgeo import gdal
import netCDF4
import json
import os
import sys
import datetime
import time
import argparse
def get_output_filename(output_dir, source_file, month, product_name, ver):
if not os.path.exists(output_dir):
os.makedirs(output_dir)
parts = sourc... | false | true |
f741cc518c05a8b391a1bc8b2ebc2d8a787955a9 | 9,594 | py | Python | doc/conf.py | sdss/lvmutil | 1938f6e1d7f4074a90a55570a316886850c5c6af | [
"BSD-3-Clause"
] | null | null | null | doc/conf.py | sdss/lvmutil | 1938f6e1d7f4074a90a55570a316886850c5c6af | [
"BSD-3-Clause"
] | null | null | null | doc/conf.py | sdss/lvmutil | 1938f6e1d7f4074a90a55570a316886850c5c6af | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# desiutil documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 9 10:43:33 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | 32.086957 | 122 | 0.714822 |
import sys
import os
from importlib import import_module
sys.path.insert(0, os.path.abspath('../py'))
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon'
]
intersphinx_map... | true | true |
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 |
f741cdd2780deb008d587ff908c9f84b9d0b0a97 | 6,909 | py | Python | LuigiTasks/GraphAnalysis.py | garnachod/ConcursoPolicia | f123595afc697ddfa862114a228d7351e2f8fd73 | [
"Apache-2.0"
] | null | null | null | LuigiTasks/GraphAnalysis.py | garnachod/ConcursoPolicia | f123595afc697ddfa862114a228d7351e2f8fd73 | [
"Apache-2.0"
] | null | null | null | LuigiTasks/GraphAnalysis.py | garnachod/ConcursoPolicia | f123595afc697ddfa862114a228d7351e2f8fd73 | [
"Apache-2.0"
] | null | null | null | import luigi
import datetime
import networkx as nx
from DBbridge.ConsultasCassandra import ConsultasCassandra
from DBbridge.ConsultasNeo4j import ConsultasNeo4j
from RecolectorTwitter import RecolectorUsuarioTwitter, RecolectorFavoritosTwitter
from Config.Conf import Conf
def remove_edges(g, in_degree=1):
g2=g.cop... | 26.883268 | 114 | 0.730207 | import luigi
import datetime
import networkx as nx
from DBbridge.ConsultasCassandra import ConsultasCassandra
from DBbridge.ConsultasNeo4j import ConsultasNeo4j
from RecolectorTwitter import RecolectorUsuarioTwitter, RecolectorFavoritosTwitter
from Config.Conf import Conf
def remove_edges(g, in_degree=1):
g2=g.cop... | false | 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 |
f741e93da5396f6e3db574cd0ca7f6d988864c56 | 3,115 | py | Python | scripts/ru/msk_parse.py | PierreMesure/openaddresses | 1e9832486bb093ecf40647897c3f2e76d243129e | [
"BSD-3-Clause"
] | 2,430 | 2015-01-04T02:36:04.000Z | 2022-03-31T02:49:11.000Z | scripts/ru/msk_parse.py | bendathierrycom/openaddresses | cad047ce386f9154831b0b02083728464053dc05 | [
"BSD-3-Clause"
] | 4,505 | 2015-01-01T00:24:28.000Z | 2022-03-29T18:51:53.000Z | scripts/ru/msk_parse.py | bendathierrycom/openaddresses | cad047ce386f9154831b0b02083728464053dc05 | [
"BSD-3-Clause"
] | 1,063 | 2015-01-01T22:35:22.000Z | 2022-03-27T09:53:18.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
import re
import sys
import requests
import json
from shapely.geometry import Polygon, Point
base_url = "http://api.data.mos.ru/v1/datasets/1927/"
dump_filename = "/users/seriozha/Downloads/ru-msk.csv"
s = requests.Session()
outfile = open(dump_filename,'w')
count = int(s.... | 25.325203 | 95 | 0.607384 |
import re
import sys
import requests
import json
from shapely.geometry import Polygon, Point
base_url = "http://api.data.mos.ru/v1/datasets/1927/"
dump_filename = "/users/seriozha/Downloads/ru-msk.csv"
s = requests.Session()
outfile = open(dump_filename,'w')
count = int(s.get(base_url + "count").content)
print ... | false | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.