hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7fea14b02a1a8d2b002bb7dfd2a72defa7e5ba2 | 435 | py | Python | tests/integration/cli/test_misc.py | Ninjagod1251/ape | 9b40ef15f25362ddb83cb6d571d60cab041fce4a | [
"Apache-2.0"
] | null | null | null | tests/integration/cli/test_misc.py | Ninjagod1251/ape | 9b40ef15f25362ddb83cb6d571d60cab041fce4a | [
"Apache-2.0"
] | 1 | 2022-02-12T01:31:16.000Z | 2022-02-22T00:26:49.000Z | tests/integration/cli/test_misc.py | Ninjagod1251/ape | 9b40ef15f25362ddb83cb6d571d60cab041fce4a | [
"Apache-2.0"
] | null | null | null | import pytest
# NOTE: test all the things without a direct test elsewhere
@pytest.mark.parametrize(
"args",
(
[],
["--version"],
["--config"],
["--help"],
["accounts"],
["networks"],
["networks", "list"],
["plugins"],
),
)
def test_invocation... | 20.714286 | 59 | 0.537931 | import pytest
@pytest.mark.parametrize(
"args",
(
[],
["--version"],
["--config"],
["--help"],
["accounts"],
["networks"],
["networks", "list"],
["plugins"],
),
)
def test_invocation(ape_cli, runner, args):
result = runner.invoke(ape_cli... | true | true |
f7fea14b9dbf1257815be16f64f7d7f300f8a3ce | 3,542 | py | Python | ss_baselines/savi/ppo/slurm_utils.py | tynguyen/sound-spaces | b196f3a36b4076752400cbf186e9cf2e160cc3c2 | [
"CC-BY-4.0"
] | 171 | 2020-08-21T06:45:19.000Z | 2022-03-30T03:52:15.000Z | ss_baselines/savi/ppo/slurm_utils.py | tynguyen/sound-spaces | b196f3a36b4076752400cbf186e9cf2e160cc3c2 | [
"CC-BY-4.0"
] | 69 | 2020-09-19T02:44:10.000Z | 2022-03-17T03:57:55.000Z | ss_baselines/savi/ppo/slurm_utils.py | tynguyen/sound-spaces | b196f3a36b4076752400cbf186e9cf2e160cc3c2 | [
"CC-BY-4.0"
] | 41 | 2020-08-25T06:58:24.000Z | 2022-03-23T05:04:47.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import os
import shlex
import signal
import subprocess
import threading
from os import path as osp
f... | 31.070175 | 100 | 0.702428 |
import os
import shlex
import signal
import subprocess
import threading
from os import path as osp
from typing import Any, Optional, Tuple
import ifcfg
import torch
from habitat import logger
EXIT = threading.Event()
EXIT.clear()
REQUEUE = threading.Event()
REQUEUE.clear()
MAIN_PID = os.getpid()
SLURM_JOBI... | true | true |
f7fea1617c298d6aef3b24ec994ae3293db8c25b | 4,360 | py | Python | app/recipe/tests/test_ingredient_api.py | batorgil-it/recipe-app-api | 9bd69bccc44242433343161e090855aa0a8c2843 | [
"MIT"
] | null | null | null | app/recipe/tests/test_ingredient_api.py | batorgil-it/recipe-app-api | 9bd69bccc44242433343161e090855aa0a8c2843 | [
"MIT"
] | null | null | null | app/recipe/tests/test_ingredient_api.py | batorgil-it/recipe-app-api | 9bd69bccc44242433343161e090855aa0a8c2843 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Ingredient, Recipe
from recipe.serializers import IngredientSerializer
INGREDIENTS_URL = reverse('recipe... | 33.538462 | 78 | 0.655963 | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Ingredient, Recipe
from recipe.serializers import IngredientSerializer
INGREDIENTS_URL = reverse('recipe... | true | true |
f7fea197c5b830dace3c2856d8b12e8ec7f4599d | 124 | py | Python | blanc_basic_news/apps.py | src-r-r/blanc-basic-news | d381207ca19779a870ae8002eeca89c4120c4604 | [
"BSD-3-Clause"
] | null | null | null | blanc_basic_news/apps.py | src-r-r/blanc-basic-news | d381207ca19779a870ae8002eeca89c4120c4604 | [
"BSD-3-Clause"
] | null | null | null | blanc_basic_news/apps.py | src-r-r/blanc-basic-news | d381207ca19779a870ae8002eeca89c4120c4604 | [
"BSD-3-Clause"
] | 1 | 2020-10-17T00:34:25.000Z | 2020-10-17T00:34:25.000Z | from django.apps import AppConfig
class BlancBasicNewsConfig(AppConfig):
name = 'blanc_basic_news'
label = 'news'
| 17.714286 | 38 | 0.741935 | from django.apps import AppConfig
class BlancBasicNewsConfig(AppConfig):
name = 'blanc_basic_news'
label = 'news'
| true | true |
f7fea1aee2403c3c2398f649b31634e0eb2c5b93 | 90,631 | py | Python | contentcuration/contentcuration/models.py | ozer550/studio | b69c625d223350b1b4a6909904ec4b44f80b211d | [
"MIT"
] | 6 | 2016-02-02T12:49:54.000Z | 2017-12-05T21:00:01.000Z | contentcuration/contentcuration/models.py | ozer550/studio | b69c625d223350b1b4a6909904ec4b44f80b211d | [
"MIT"
] | 195 | 2015-05-19T20:37:51.000Z | 2018-02-27T19:06:54.000Z | contentcuration/contentcuration/models.py | ozer550/studio | b69c625d223350b1b4a6909904ec4b44f80b211d | [
"MIT"
] | 33 | 2015-05-06T19:19:09.000Z | 2017-11-16T12:50:54.000Z | import functools
import hashlib
import json
import logging
import os
import urllib.parse
import uuid
from datetime import datetime
import pytz
from celery import states
from django.conf import settings
from django.contrib.auth.base_user import AbstractBaseUser
from django.contrib.auth.base_user import BaseUserManager
... | 39.404783 | 157 | 0.653717 | import functools
import hashlib
import json
import logging
import os
import urllib.parse
import uuid
from datetime import datetime
import pytz
from celery import states
from django.conf import settings
from django.contrib.auth.base_user import AbstractBaseUser
from django.contrib.auth.base_user import BaseUserManager
... | true | true |
f7fea2cb66b964a840b93207eec7e268160a0629 | 8,236 | py | Python | wechatter/server/run_server.py | we-chatter/wechatter | 52f884ba938e4b2248abca24efc22ac0fbbbaf1e | [
"Apache-2.0"
] | 11 | 2020-11-20T03:28:06.000Z | 2022-03-02T11:47:06.000Z | wechatter/server/run_server.py | we-chatter/wechatter | 52f884ba938e4b2248abca24efc22ac0fbbbaf1e | [
"Apache-2.0"
] | null | null | null | wechatter/server/run_server.py | we-chatter/wechatter | 52f884ba938e4b2248abca24efc22ac0fbbbaf1e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@Author : Xu
@Software: PyCharm
@File : run_server.py
@Time : 2020/8/26 2:50 下午
@Desc :
"""
import asyncio
import concurrent.futures
import logging
import multiprocessing
import os
import tempfile
import traceback
from collections import defaultdict
from functools imp... | 29 | 98 | 0.65238 |
import asyncio
import concurrent.futures
import logging
import multiprocessing
import os
import tempfile
import traceback
from collections import defaultdict
from functools import reduce, wraps
from inspect import isawaitable
from pathlib import Path
from http import HTTPStatus
from typing import (
Any,
Call... | true | true |
f7fea30701fb8857c9dbeef81f81df1976216321 | 413 | py | Python | tools/clang/pylib/clang/PRESUBMIT.py | DamieFC/chromium | 54ce2d3c77723697efd22cfdb02aea38f9dfa25c | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2020-10-18T02:33:40.000Z | 2020-10-18T02:33:40.000Z | tools/clang/pylib/clang/PRESUBMIT.py | DamieFC/chromium | 54ce2d3c77723697efd22cfdb02aea38f9dfa25c | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 3 | 2021-05-17T16:28:52.000Z | 2021-05-21T22:42:22.000Z | tools/clang/pylib/clang/PRESUBMIT.py | DamieFC/chromium | 54ce2d3c77723697efd22cfdb02aea38f9dfa25c | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | # Copyright 2019 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.
USE_PYTHON3 = True
def CheckChangeOnCommit(input_api, output_api):
results = []
# Run the unit tests.
results.extend(input_api.canned_checks.RunUni... | 24.294118 | 72 | 0.728814 |
USE_PYTHON3 = True
def CheckChangeOnCommit(input_api, output_api):
results = []
results.extend(input_api.canned_checks.RunUnitTestsInDirectory(
input_api, output_api, '.', [ r'^.+_test\.py$']))
return results
| true | true |
f7fea3e2a5044ecd3601076e3fcad84a661b03cb | 5,915 | py | Python | submission_version/code/bing.py | jingchengdeng/Satellite-Aerial-Image-Retrieval | 7ed8316fae20ea9e07db12051b1ee7a895c50f3b | [
"MIT"
] | null | null | null | submission_version/code/bing.py | jingchengdeng/Satellite-Aerial-Image-Retrieval | 7ed8316fae20ea9e07db12051b1ee7a895c50f3b | [
"MIT"
] | null | null | null | submission_version/code/bing.py | jingchengdeng/Satellite-Aerial-Image-Retrieval | 7ed8316fae20ea9e07db12051b1ee7a895c50f3b | [
"MIT"
] | null | null | null | import sys, math, logging, json, mpmath, io
from urllib import request, error
from PIL import Image
class Bing():
def __init__(self):
self.dataPath = "http://dev.virtualearth.net/REST/v1/Imagery/Metadata/Aerial"
self.myKey = "AvHyA8kJY_qxax2ciNHnW61HCz6GxqM6wZr2sLIMYCpsVYSb8BVmJCauCSKLS_5p"
... | 39.433333 | 137 | 0.550972 | import sys, math, logging, json, mpmath, io
from urllib import request, error
from PIL import Image
class Bing():
def __init__(self):
self.dataPath = "http://dev.virtualearth.net/REST/v1/Imagery/Metadata/Aerial"
self.myKey = "AvHyA8kJY_qxax2ciNHnW61HCz6GxqM6wZr2sLIMYCpsVYSb8BVmJCauCSKLS_5p"
... | true | true |
f7fea4e9ff72d29e31375a1c9c38bc540a5a038b | 10,277 | py | Python | job.py | DIR-LAB/delayscheduling | 12539897f8de3052d97fa99239ccc0a01766cc87 | [
"MIT"
] | null | null | null | job.py | DIR-LAB/delayscheduling | 12539897f8de3052d97fa99239ccc0a01766cc87 | [
"MIT"
] | null | null | null | job.py | DIR-LAB/delayscheduling | 12539897f8de3052d97fa99239ccc0a01766cc87 | [
"MIT"
] | null | null | null | import re
import sys
import math
class Job:
"""
1. Job Number -- a counter field, starting from 1.
2. Submit Time -- in seconds. The earliest time the log refers to is zero, and is usually the submittal time of the first job. The lines in the log are sorted by ascending submittal times. It makes sense for... | 53.248705 | 391 | 0.659336 | import re
import sys
import math
class Job:
def __init__(self, line = "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"):
line = line.strip()
s_array = re.split("\\s+", line)
self.job_id = int(s_array[0])
self.submit_time = int(s_array[1])
self.wait_ti... | true | true |
f7fea50826973fa6874dd4ae8cf65067ae41473d | 540 | py | Python | setup.py | pu-bioinformatics/PythonMiniProject-urbanslug | 6ea908d671a7df0b4f6b23d352d20defd8bae3c5 | [
"MIT"
] | null | null | null | setup.py | pu-bioinformatics/PythonMiniProject-urbanslug | 6ea908d671a7df0b4f6b23d352d20defd8bae3c5 | [
"MIT"
] | null | null | null | setup.py | pu-bioinformatics/PythonMiniProject-urbanslug | 6ea908d671a7df0b4f6b23d352d20defd8bae3c5 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name = "Amino",
version = "0.0.0.1",
description = "A collection of modules for performing simple PDB file analysis.",
long_description=long_description,
long_description_content_... | 28.421053 | 85 | 0.694444 | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name = "Amino",
version = "0.0.0.1",
description = "A collection of modules for performing simple PDB file analysis.",
long_description=long_description,
long_description_content_... | true | true |
f7fea5380d6b55b8daacfad11c52c84be1a0a325 | 66,896 | py | Python | nephoria/testcase_utils/cli_test_runner.py | bigschwan/nephology | b09cc34c6796a1737159b2976526a7dbb530b364 | [
"BSD-2-Clause"
] | 5 | 2016-08-31T06:51:18.000Z | 2018-04-25T20:50:25.000Z | nephoria/testcase_utils/cli_test_runner.py | bigschwan/nephology | b09cc34c6796a1737159b2976526a7dbb530b364 | [
"BSD-2-Clause"
] | 49 | 2016-04-19T07:01:46.000Z | 2017-11-17T23:57:18.000Z | nephoria/testcase_utils/cli_test_runner.py | bigschwan/nephology | b09cc34c6796a1737159b2976526a7dbb530b364 | [
"BSD-2-Clause"
] | 14 | 2016-04-14T17:01:35.000Z | 2021-07-13T13:35:38.000Z | """
This is the base class for any test case to be included in the Nephoria repo. It should include any
functionality that we expect to be repeated in most of the test cases that will be written.
These wrapper/harness classes are primarily intended to help provide a common means of running and
reporting 'system level t... | 43.552083 | 100 | 0.549315 | """
This is the base class for any test case to be included in the Nephoria repo. It should include any
functionality that we expect to be repeated in most of the test cases that will be written.
These wrapper/harness classes are primarily intended to help provide a common means of running and
reporting 'system level t... | false | true |
f7fea78f10f057100d5d075562c44ca6b4ec1edc | 666 | py | Python | server/instance.py | elieltonlimeira/desafio-backend | c5c0418bb8970d50114e76feaf9f52b2c9522e70 | [
"Unlicense"
] | null | null | null | server/instance.py | elieltonlimeira/desafio-backend | c5c0418bb8970d50114e76feaf9f52b2c9522e70 | [
"Unlicense"
] | null | null | null | server/instance.py | elieltonlimeira/desafio-backend | c5c0418bb8970d50114e76feaf9f52b2c9522e70 | [
"Unlicense"
] | null | null | null | from flask import Flask, Blueprint
from flask_sqlalchemy import SQLAlchemy
class Server():
def __init__(self, ):
self.app = Flask(__name__)
self.blueprint = Blueprint('api', __name__, url_prefix='/api')
self.app.register_blueprint(self.blueprint)
self.app.config['SQLALCHEMY... | 28.956522 | 72 | 0.617117 | from flask import Flask, Blueprint
from flask_sqlalchemy import SQLAlchemy
class Server():
def __init__(self, ):
self.app = Flask(__name__)
self.blueprint = Blueprint('api', __name__, url_prefix='/api')
self.app.register_blueprint(self.blueprint)
self.app.config['SQLALCHEMY... | true | true |
f7fea95c31ee9479ef6cfbd57953d815677e4156 | 3,012 | py | Python | Archive/Kizmeow NFT Tracker V2/cogs/project_nft.py | Xeift/Kizmeow-OpenSea-and-Etherscan-Discord-Bot | 2ea42ec9d48f18f284724267876795d473d158c7 | [
"MIT"
] | 70 | 2021-12-20T00:37:04.000Z | 2022-03-30T07:06:49.000Z | Archive/Kizmeow NFT Tracker V2/cogs/project_nft.py | Xeift/Kizmeow-OpenSea-and-Etherscan-Discord-Bot | 2ea42ec9d48f18f284724267876795d473d158c7 | [
"MIT"
] | null | null | null | Archive/Kizmeow NFT Tracker V2/cogs/project_nft.py | Xeift/Kizmeow-OpenSea-and-Etherscan-Discord-Bot | 2ea42ec9d48f18f284724267876795d473d158c7 | [
"MIT"
] | 22 | 2021-12-21T07:27:24.000Z | 2022-03-11T11:51:36.000Z | import discord
from discord_slash.utils.manage_commands import create_option
import urllib.request as ur
import json
from discord_slash import cog_ext
from core.cog_core import cogcore
class project_nft(cogcore):
@cog_ext.cog_slash(name="project_nft",
description="return some useful information about your NFT from... | 29.821782 | 113 | 0.668327 | import discord
from discord_slash.utils.manage_commands import create_option
import urllib.request as ur
import json
from discord_slash import cog_ext
from core.cog_core import cogcore
class project_nft(cogcore):
@cog_ext.cog_slash(name="project_nft",
description="return some useful information about your NFT from... | true | true |
f7fea95f581bdfeabe4a96fba459430c751bc2d2 | 5,108 | py | Python | app/views/mqttc/Client.py | RedFalsh/flask-example | 561b04d31356cf1a4a0324a89ebc4f3dcd94e16c | [
"MIT"
] | 1 | 2019-02-26T07:40:07.000Z | 2019-02-26T07:40:07.000Z | app/views/mqttc/Client.py | RedFalsh/flask-example | 561b04d31356cf1a4a0324a89ebc4f3dcd94e16c | [
"MIT"
] | null | null | null | app/views/mqttc/Client.py | RedFalsh/flask-example | 561b04d31356cf1a4a0324a89ebc4f3dcd94e16c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
from app.views.mqttc import route_mqtt
from app import app, mqtt, db
from app.model import Device,DeviceTime,DeviceOperateLog
from app.common.libs.MqttService import CMD
from app.common.libs.Helper import getFormatDate, getCurrentDate
from app.common.libs.Logging import logger
... | 34.748299 | 105 | 0.550117 |
from app.views.mqttc import route_mqtt
from app import app, mqtt, db
from app.model import Device,DeviceTime,DeviceOperateLog
from app.common.libs.MqttService import CMD
from app.common.libs.Helper import getFormatDate, getCurrentDate
from app.common.libs.Logging import logger
import re
import json
import time, th... | true | true |
f7fea96a2be03bff6ff06044c7287908b5916edf | 388 | py | Python | Python_Exercicios/Mundo1/Tipos Primitivos e Saída de Dados/python_013.py | jbauermanncode/Curso_Em_Video_Python | 330c207d7bed4e663fe1b9ab433ab57a9828b7f1 | [
"MIT"
] | null | null | null | Python_Exercicios/Mundo1/Tipos Primitivos e Saída de Dados/python_013.py | jbauermanncode/Curso_Em_Video_Python | 330c207d7bed4e663fe1b9ab433ab57a9828b7f1 | [
"MIT"
] | null | null | null | Python_Exercicios/Mundo1/Tipos Primitivos e Saída de Dados/python_013.py | jbauermanncode/Curso_Em_Video_Python | 330c207d7bed4e663fe1b9ab433ab57a9828b7f1 | [
"MIT"
] | null | null | null | '''
Faça um algoritmo que leia o salario de um funcionário e mostre seu novo salário, com 15% de aumento.
'''
# Leia Salário
salario = float(input('Qual é o salário do funcionário? R$'))
# Calcular novo Salário
novo = salario + (salario * 15 / 100)
# Imprimir na tela
print('Um funcionário que ganhava R${:.2f}, co... | 32.333333 | 113 | 0.695876 |
salario = float(input('Qual é o salário do funcionário? R$'))
novo = salario + (salario * 15 / 100)
print('Um funcionário que ganhava R${:.2f}, com 15% de aumento, passou a receber R${:.2f}'.format(salario, novo))
| true | true |
f7fea9d65ff0fc7e30ac7de150859dc210be6008 | 83,662 | py | Python | test/api/test_workflows.py | chambm/galaxy | fd1926767996a161cd2fc8bd184e6835fd688765 | [
"CC-BY-3.0"
] | null | null | null | test/api/test_workflows.py | chambm/galaxy | fd1926767996a161cd2fc8bd184e6835fd688765 | [
"CC-BY-3.0"
] | 1 | 2019-02-04T16:21:27.000Z | 2019-02-04T16:45:17.000Z | test/api/test_workflows.py | chambm/galaxy | fd1926767996a161cd2fc8bd184e6835fd688765 | [
"CC-BY-3.0"
] | null | null | null | from __future__ import print_function
import time
from collections import namedtuple
from json import dumps
from uuid import uuid4
import yaml
from requests import delete, put
from base import api
from base.populators import (
DatasetCollectionPopulator,
DatasetPopulator,
skip_without_tool,
wait_on,
... | 41.416832 | 179 | 0.673986 | from __future__ import print_function
import time
from collections import namedtuple
from json import dumps
from uuid import uuid4
import yaml
from requests import delete, put
from base import api
from base.populators import (
DatasetCollectionPopulator,
DatasetPopulator,
skip_without_tool,
wait_on,
... | true | true |
f7feaa3a85aacf8905df1928db8d5ee842524215 | 8,094 | py | Python | core/settings.py | rectory-school/rectory-apps-updated | a6d47f6d5928f0c816eb45fd229da2f9f2fa2ff1 | [
"MIT"
] | null | null | null | core/settings.py | rectory-school/rectory-apps-updated | a6d47f6d5928f0c816eb45fd229da2f9f2fa2ff1 | [
"MIT"
] | 30 | 2021-07-16T12:54:14.000Z | 2021-12-24T16:59:04.000Z | core/settings.py | rectory-school/rectory-apps-updated | a6d47f6d5928f0c816eb45fd229da2f9f2fa2ff1 | [
"MIT"
] | null | null | null | """
Django settings for core project.
Generated by 'django-admin startproject' using Django 3.2.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib im... | 28.5 | 119 | 0.675562 |
from pathlib import Path
import socket
import uuid
import json
from email.utils import parseaddr
import environ
env = environ.Env()
BASE_DIR = Path(__file__).resolve().parent.parent
if (dotenv := (BASE_DIR / ".env")).exists():
environ.Env.read_env(dotenv)
DEBUG = env.bool('DEBUG', default=False)
SECRET_KEY =... | true | true |
f7feac26a36903f73b984dcc0360155b4034e6fc | 8,257 | py | Python | src/tantale/livestatus/parser.py | redref/tantale | 358748e7d4a1d87ee48168a03ed68acefb2b9ca2 | [
"Apache-2.0"
] | null | null | null | src/tantale/livestatus/parser.py | redref/tantale | 358748e7d4a1d87ee48168a03ed68acefb2b9ca2 | [
"Apache-2.0"
] | null | null | null | src/tantale/livestatus/parser.py | redref/tantale | 358748e7d4a1d87ee48168a03ed68acefb2b9ca2 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import traceback
import logging
from six import b as bytes
from tantale.livestatus.query import Query
from tantale.livestatus.command import Command
from tantale.livestatus.mapping import *
class Parser(object):
def __init__(self):
self.log = logging.getLogger('tantale.livestatus')
d... | 36.056769 | 77 | 0.475354 |
import traceback
import logging
from six import b as bytes
from tantale.livestatus.query import Query
from tantale.livestatus.command import Command
from tantale.livestatus.mapping import *
class Parser(object):
def __init__(self):
self.log = logging.getLogger('tantale.livestatus')
def field_map(s... | true | true |
f7feac98c8b3082ebe0c888471fdd159a3744560 | 1,282 | py | Python | keepmail/keepmail.py | rgravina/keepmail | 1f53db02ffda8f363ada31340a21eeab176b15ff | [
"MIT"
] | 1 | 2016-05-09T01:19:44.000Z | 2016-05-09T01:19:44.000Z | keepmail/keepmail.py | rgravina/keepmail | 1f53db02ffda8f363ada31340a21eeab176b15ff | [
"MIT"
] | null | null | null | keepmail/keepmail.py | rgravina/keepmail | 1f53db02ffda8f363ada31340a21eeab176b15ff | [
"MIT"
] | null | null | null | """
A dummy mail server.
"""
from zope.interface import implements
from twisted.internet import defer
from twisted.mail import smtp
class ConsoleMessageDelivery:
implements(smtp.IMessageDelivery)
def receivedHeader(self, helo, origin, recipients):
return "Received: ConsoleMessageDelivery"
d... | 25.137255 | 57 | 0.649766 | """
A dummy mail server.
"""
from zope.interface import implements
from twisted.internet import defer
from twisted.mail import smtp
class ConsoleMessageDelivery:
implements(smtp.IMessageDelivery)
def receivedHeader(self, helo, origin, recipients):
return "Received: ConsoleMessageDelivery"
d... | false | true |
f7feaddd207f56faba601b1f8ec86bfa765334c4 | 5,134 | py | Python | torch/fx/passes/shape_prop.py | stungkit/pytorch | 0f05e398705bf15406bce79f7ee57d3935ad2abd | [
"Intel"
] | 2 | 2020-03-13T06:57:49.000Z | 2020-05-17T04:18:14.000Z | torch/fx/passes/shape_prop.py | ellhe-blaster/pytorch | e5282c3cb8bf6ad8c5161f9d0cc271edb9abed25 | [
"Intel"
] | 1 | 2022-01-10T18:39:28.000Z | 2022-01-10T19:15:57.000Z | torch/fx/passes/shape_prop.py | ellhe-blaster/pytorch | e5282c3cb8bf6ad8c5161f9d0cc271edb9abed25 | [
"Intel"
] | 1 | 2022-03-26T14:42:50.000Z | 2022-03-26T14:42:50.000Z | import torch
import torch.fx
import traceback
from torch.fx.node import Node, map_aggregate
from typing import Any, Tuple, NamedTuple, Optional, Dict
from torch.fx._compatibility import compatibility
@compatibility(is_backward_compatible=True)
class TensorMetadata(NamedTuple):
# TensorMetadata is a structure con... | 33.776316 | 120 | 0.626217 | import torch
import torch.fx
import traceback
from torch.fx.node import Node, map_aggregate
from typing import Any, Tuple, NamedTuple, Optional, Dict
from torch.fx._compatibility import compatibility
@compatibility(is_backward_compatible=True)
class TensorMetadata(NamedTuple):
shape : torch.Size
... | true | true |
f7feadebaa83dcc91746056196a01efa6f54fb3e | 19,302 | py | Python | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/operations/_data_collection_rule_associations_operations.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/operations/_data_collection_rule_associations_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/operations/_data_collection_rule_associations_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.989848 | 208 | 0.672055 |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport impor... | true | true |
f7feae564d8b035286fd8c12171874b1579e9828 | 9,012 | py | Python | examples/llvm_autotuning/executor.py | bcui19/CompilerGym | b3d23cf23c4242df8cf8f54f55db79ef3091eabf | [
"MIT"
] | null | null | null | examples/llvm_autotuning/executor.py | bcui19/CompilerGym | b3d23cf23c4242df8cf8f54f55db79ef3091eabf | [
"MIT"
] | null | null | null | examples/llvm_autotuning/executor.py | bcui19/CompilerGym | b3d23cf23c4242df8cf8f54f55db79ef3091eabf | [
"MIT"
] | 1 | 2022-02-16T04:02:46.000Z | 2022-02-16T04:02:46.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import multiprocessing
from collections import deque
from contextlib import contextmanager
from enum import Enum
from itertools ... | 32.301075 | 88 | 0.610519 |
import logging
import multiprocessing
from collections import deque
from contextlib import contextmanager
from enum import Enum
from itertools import islice
from pathlib import Path
from typing import Optional
from pydantic import BaseModel, Field, validator
from pydantic.class_validators import root_validator
fro... | true | true |
f7feafcf1bad77c660800c13f3f0c48a2aad8193 | 8,554 | py | Python | official/utils/misc/keras_utils.py | shere-khan/models | ab1858370a204f793c9d609b05ff60e001d403e6 | [
"Apache-2.0"
] | null | null | null | official/utils/misc/keras_utils.py | shere-khan/models | ab1858370a204f793c9d609b05ff60e001d403e6 | [
"Apache-2.0"
] | null | null | null | official/utils/misc/keras_utils.py | shere-khan/models | ab1858370a204f793c9d609b05ff60e001d403e6 | [
"Apache-2.0"
] | 1 | 2020-03-07T06:46:16.000Z | 2020-03-07T06:46:16.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.030303 | 80 | 0.710779 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import multiprocessing
import os
import time
from absl import logging
import tensorflow as tf
from tensorflow.core.protobuf import rewriter_config_pb2
from tensorflow.python import tf2
from tens... | true | true |
f7feb0e2e9881b591a8395aad6147bfe159bdcf9 | 1,202 | py | Python | setup.py | axant/tgapp-stroller2 | 3866335cf4d69f306edd8055dd91b3188b53c868 | [
"MIT"
] | null | null | null | setup.py | axant/tgapp-stroller2 | 3866335cf4d69f306edd8055dd91b3188b53c868 | [
"MIT"
] | null | null | null | setup.py | axant/tgapp-stroller2 | 3866335cf4d69f306edd8055dd91b3188b53c868 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys, os
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
install_requires=[
"TurboGears2 >= 2.3.3",
"tgext.pluggable",
"tw2.core",
"tw2.f... | 24.04 | 90 | 0.610649 |
import sys, os
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
install_requires=[
"TurboGears2 >= 2.3.3",
"tgext.pluggable",
"tw2.core",
"tw2.forms",
"tgext.ecomm... | true | true |
f7feb1f494afa560b1f20e3ca0b86d74720e8449 | 508 | py | Python | Algorithms/Search Insert Position.py | KushRabadia/Leetcode | f6af5bf0b9ef8daf9870570b52012297128aa9e1 | [
"MIT"
] | null | null | null | Algorithms/Search Insert Position.py | KushRabadia/Leetcode | f6af5bf0b9ef8daf9870570b52012297128aa9e1 | [
"MIT"
] | null | null | null | Algorithms/Search Insert Position.py | KushRabadia/Leetcode | f6af5bf0b9ef8daf9870570b52012297128aa9e1 | [
"MIT"
] | null | null | null | class Solution(object):
def searchInsert(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
first = 0
last = len(nums)-1
mid = (first+last)//2
while first<=last:
if nums[mid]<target:
fi... | 22.086957 | 41 | 0.423228 | class Solution(object):
def searchInsert(self, nums, target):
first = 0
last = len(nums)-1
mid = (first+last)//2
while first<=last:
if nums[mid]<target:
first = mid +1
elif nums[mid]>target:
last = mid -1
else:
... | true | true |
f7feb25310c0b8253334d4a1506e1fc1731398c2 | 37,694 | py | Python | numpy/lib/histograms.py | MilesCranmer/numpy | 7a1ee13ee28083c484a42a657067570773bcddbe | [
"BSD-3-Clause"
] | null | null | null | numpy/lib/histograms.py | MilesCranmer/numpy | 7a1ee13ee28083c484a42a657067570773bcddbe | [
"BSD-3-Clause"
] | 8 | 2021-10-07T10:59:49.000Z | 2021-11-22T20:06:49.000Z | numpy/lib/histograms.py | MilesCranmer/numpy | 7a1ee13ee28083c484a42a657067570773bcddbe | [
"BSD-3-Clause"
] | null | null | null | """
Histogram-related functions
"""
import contextlib
import functools
import operator
import warnings
import numpy as np
from numpy.core import overrides
__all__ = ['histogram', 'histogramdd', 'histogram_bin_edges']
array_function_dispatch = functools.partial(
overrides.array_function_dispatch, module='numpy')
... | 35.195145 | 104 | 0.612803 | import contextlib
import functools
import operator
import warnings
import numpy as np
from numpy.core import overrides
__all__ = ['histogram', 'histogramdd', 'histogram_bin_edges']
array_function_dispatch = functools.partial(
overrides.array_function_dispatch, module='numpy')
_range = range
def _ptp(x):
... | true | true |
f7feb295357776d5237bdbb075cba1587befd7ba | 1,456 | py | Python | CSD_modeling/extract_arc.py | seanandrews/DSHARP_CPDs | 40d8f02945e0d412c5c912b050d4a3d8c6dbbfa2 | [
"MIT"
] | 1 | 2020-05-04T15:55:03.000Z | 2020-05-04T15:55:03.000Z | CSD_modeling/extract_arc.py | seanandrews/DSHARP_CPDs | 40d8f02945e0d412c5c912b050d4a3d8c6dbbfa2 | [
"MIT"
] | null | null | null | CSD_modeling/extract_arc.py | seanandrews/DSHARP_CPDs | 40d8f02945e0d412c5c912b050d4a3d8c6dbbfa2 | [
"MIT"
] | 1 | 2020-09-22T19:04:48.000Z | 2020-09-22T19:04:48.000Z | import os
import numpy as np
execfile('ExportMS.py')
# read which disk this is about
target = str(np.loadtxt('whichdisk.txt', dtype='str'))
# load FITS model of the arc (the modified CLEAN model)
importfits(fitsimage='data/'+target+'_data_arc.cleanmodel.fits',
imagename='data/'+target+'_data_arc.cleanmodel... | 39.351351 | 79 | 0.707418 | import os
import numpy as np
execfile('ExportMS.py')
target = str(np.loadtxt('whichdisk.txt', dtype='str'))
importfits(fitsimage='data/'+target+'_data_arc.cleanmodel.fits',
imagename='data/'+target+'_data_arc.cleanmodel', overwrite=True)
os.system('rm -rf data/'+target+'_data.ms*')
os.system('cp -r da... | true | true |
f7feb45b8caec3d7483b4842c53a356fbd2df5e1 | 3,812 | py | Python | example/tlo-EX-Data.py | sspickle/genlatex | d5fd86d4415c85c2f2933981e0e65f9df9f3cda5 | [
"MIT"
] | null | null | null | example/tlo-EX-Data.py | sspickle/genlatex | d5fd86d4415c85c2f2933981e0e65f9df9f3cda5 | [
"MIT"
] | null | null | null | example/tlo-EX-Data.py | sspickle/genlatex | d5fd86d4415c85c2f2933981e0e65f9df9f3cda5 | [
"MIT"
] | 1 | 2021-08-01T17:12:18.000Z | 2021-08-01T17:12:18.000Z |
import random
import vpython as vp
import numpy as np
from genlatex import latex_float, latex_vec
data = []
"""
naming convention.
tlo: this is the prefix to all the templates, and to the .tex outputs
e.g., if you're working on TLO-3 and this is the third quiz you've
given, you might say "tlo = 'TLO-3v3' and the... | 29.323077 | 79 | 0.583158 |
import random
import vpython as vp
import numpy as np
from genlatex import latex_float, latex_vec
data = []
tlo='TLO-EX'
templateFile = tlo + '-template.txt'
quizFilenameTemplate = tlo + '-{:}.tex'
quizSolnFilenameTemplate = tlo + '-soln-{:}.tex'
qe = 1.6e-19
G = 1.67e-11
rint = random.randint
uni = random.u... | true | true |
f7feb4da5e265294647ab11c3fbcfe866e9f6c1e | 1,104 | py | Python | distributed/protocol/tests/test_cupy.py | mlhenderson/distributed | 105d040fb9cabfa3581dcdce73165c77cb22de9a | [
"BSD-3-Clause"
] | null | null | null | distributed/protocol/tests/test_cupy.py | mlhenderson/distributed | 105d040fb9cabfa3581dcdce73165c77cb22de9a | [
"BSD-3-Clause"
] | null | null | null | distributed/protocol/tests/test_cupy.py | mlhenderson/distributed | 105d040fb9cabfa3581dcdce73165c77cb22de9a | [
"BSD-3-Clause"
] | null | null | null | from distributed.protocol import serialize, deserialize
import pickle
import pytest
cupy = pytest.importorskip("cupy")
@pytest.mark.parametrize("size", [0, 10])
@pytest.mark.parametrize("dtype", ["u1", "u4", "u8", "f4"])
def test_serialize_cupy(size, dtype):
x = cupy.arange(size, dtype=dtype)
header, frames ... | 31.542857 | 86 | 0.65942 | from distributed.protocol import serialize, deserialize
import pickle
import pytest
cupy = pytest.importorskip("cupy")
@pytest.mark.parametrize("size", [0, 10])
@pytest.mark.parametrize("dtype", ["u1", "u4", "u8", "f4"])
def test_serialize_cupy(size, dtype):
x = cupy.arange(size, dtype=dtype)
header, frames ... | true | true |
f7feb6a02d26b0c108088b2869515458cb36993a | 1,159 | py | Python | layout/layout_in_form.py | thanhkaist/Qt-Python-Binding-Examples | 25b3313fd03e396014cce0e8f7eec8823b3ebd29 | [
"BSD-3-Clause"
] | 2 | 2019-10-20T05:40:51.000Z | 2019-10-31T17:26:27.000Z | qt_layouts/layout_in_form.py | bisratyalew/Qt-Python-Sample-Examples | 45d69e01adefc854ac25627110611ca27b334a55 | [
"MIT"
] | null | null | null | qt_layouts/layout_in_form.py | bisratyalew/Qt-Python-Sample-Examples | 45d69e01adefc854ac25627110611ca27b334a55 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
layout in form
Tested environment:
Mac OS X 10.6.8
"""
import sys
try:
from PySide import QtCore
from PySide import QtGui
except ImportError:
from PyQt4 import QtCore
from PyQt4 import QtGui
class Demo(QtGui.QWidget):
def __init__(self):
... | 20.696429 | 55 | 0.628991 |
import sys
try:
from PySide import QtCore
from PySide import QtGui
except ImportError:
from PyQt4 import QtCore
from PyQt4 import QtGui
class Demo(QtGui.QWidget):
def __init__(self):
super(Demo, self).__init__()
x, y, w, h = 500, 200, 300, 400
self.setGeometry(x, y, w, h... | true | true |
f7feb6c5633e4346afbd8bd79b8fd28b214d48ea | 144 | py | Python | ver1_0/openassembly/pirate_messages/tasks.py | fragro/Open-Assembly | e9679ff5e7ae9881fa5781d763288ed2f40b014d | [
"BSD-3-Clause"
] | 1 | 2015-11-05T08:22:19.000Z | 2015-11-05T08:22:19.000Z | ver1_0/openassembly/pirate_messages/tasks.py | fragro/Open-Assembly | e9679ff5e7ae9881fa5781d763288ed2f40b014d | [
"BSD-3-Clause"
] | null | null | null | ver1_0/openassembly/pirate_messages/tasks.py | fragro/Open-Assembly | e9679ff5e7ae9881fa5781d763288ed2f40b014d | [
"BSD-3-Clause"
] | 1 | 2018-02-03T18:25:41.000Z | 2018-02-03T18:25:41.000Z | from celery.task import task
@task(ignore_results=True)
def set_to_read(notes):
for i in notes:
i.is_read = True
i.save()
| 16 | 28 | 0.645833 | from celery.task import task
@task(ignore_results=True)
def set_to_read(notes):
for i in notes:
i.is_read = True
i.save()
| true | true |
f7feb76b423df24342b91752bbb1aed44778e8b4 | 827 | py | Python | Cura/Uranium/UM/View/DefaultPass.py | TIAO-JI-FU/3d-printing-with-moveo-1 | 100ecfd1208fe1890f8bada946145d716b2298eb | [
"MIT"
] | null | null | null | Cura/Uranium/UM/View/DefaultPass.py | TIAO-JI-FU/3d-printing-with-moveo-1 | 100ecfd1208fe1890f8bada946145d716b2298eb | [
"MIT"
] | null | null | null | Cura/Uranium/UM/View/DefaultPass.py | TIAO-JI-FU/3d-printing-with-moveo-1 | 100ecfd1208fe1890f8bada946145d716b2298eb | [
"MIT"
] | null | null | null | # Copyright (c) 2019 Ultimaker B.V.
# Uranium is released under the terms of the LGPLv3 or higher.
import UM.Qt.QtApplication
from UM.View.RenderPass import RenderPass
## A render pass subclass that renders everything with the default parameters.
#
# This class provides the basic rendering of the objects in the s... | 30.62963 | 109 | 0.702539 |
import UM.Qt.QtApplication
from UM.View.RenderPass import RenderPass
nt) -> None:
super().__init__("default", width, height, 0)
self._renderer = UM.Qt.QtApplication.QtApplication.getInstance().getRenderer()
def render(self) -> None:
self.bind()
camera = UM.Qt.QtApplication.Qt... | true | true |
f7feb8017d4807f43beed287f8fc3702d050a955 | 143 | py | Python | redmail/test/log/conftest.py | rveachkc/red-mail | 97a9e89e8a04e67c2824a79ce45489931b4d1b82 | [
"MIT"
] | 173 | 2022-01-01T21:16:02.000Z | 2022-03-29T06:25:42.000Z | redmail/test/log/conftest.py | rveachkc/red-mail | 97a9e89e8a04e67c2824a79ce45489931b4d1b82 | [
"MIT"
] | 36 | 2022-01-01T23:21:42.000Z | 2022-03-25T07:02:45.000Z | redmail/test/log/conftest.py | rveachkc/red-mail | 97a9e89e8a04e67c2824a79ce45489931b4d1b82 | [
"MIT"
] | 11 | 2022-01-02T12:59:58.000Z | 2022-02-27T11:12:57.000Z |
import logging
import pytest
@pytest.fixture
def logger():
logger = logging.getLogger("_test")
logger.handlers = []
return logger | 15.888889 | 39 | 0.699301 |
import logging
import pytest
@pytest.fixture
def logger():
logger = logging.getLogger("_test")
logger.handlers = []
return logger | true | true |
f7feb8b9156c3ea365d1bd5dd0296c24265c8a4a | 2,833 | py | Python | datatest/__past__/api09.py | ajhynes7/datatest | 78742e98de992807286655f5685a2dc33a7b452e | [
"Apache-2.0"
] | 277 | 2016-05-12T13:22:49.000Z | 2022-03-11T00:18:32.000Z | datatest/__past__/api09.py | ajhynes7/datatest | 78742e98de992807286655f5685a2dc33a7b452e | [
"Apache-2.0"
] | 57 | 2016-05-18T01:03:32.000Z | 2022-02-17T13:48:43.000Z | datatest/__past__/api09.py | ajhynes7/datatest | 78742e98de992807286655f5685a2dc33a7b452e | [
"Apache-2.0"
] | 16 | 2016-05-22T11:35:19.000Z | 2021-12-01T19:41:42.000Z | """Backward compatibility for version 0.9 API."""
from __future__ import absolute_import
import datatest
from datatest._compatibility.collections.abc import Mapping
from datatest._compatibility.collections.abc import Set
from datatest._normalize import normalize
from datatest._utils import IterItems
class RequiredSu... | 34.54878 | 85 | 0.690081 | from __future__ import absolute_import
import datatest
from datatest._compatibility.collections.abc import Mapping
from datatest._compatibility.collections.abc import Set
from datatest._normalize import normalize
from datatest._utils import IterItems
class RequiredSubset_090(datatest.requirements.GroupRequirement):
... | true | true |
f7feb8d87a5253d1c27c5a37431a86f31b84c72e | 5,983 | py | Python | GPGO/dpd_opt_script.py | FNTwin/BayGPGO | bad7e335d2fd19a93aeee0d591ea7da51c2c6d59 | [
"MIT"
] | null | null | null | GPGO/dpd_opt_script.py | FNTwin/BayGPGO | bad7e335d2fd19a93aeee0d591ea7da51c2c6d59 | [
"MIT"
] | null | null | null | GPGO/dpd_opt_script.py | FNTwin/BayGPGO | bad7e335d2fd19a93aeee0d591ea7da51c2c6d59 | [
"MIT"
] | null | null | null | from GPGO.GaussianProcess.GP import GP, generate_grid
from GPGO.GaussianProcess.Kernel.RBF import RBF
from GPGO.BayesOpt import BayesianOptimization
import numpy as np
import os
import argparse
def get_right_coeffs(array):
# truth_index=[2,3,6,7,9,15,16,19,20,21,24,25,30]
truth_index = [2, 6, 7, 9, 15, 19, 20... | 35.613095 | 126 | 0.536019 | from GPGO.GaussianProcess.GP import GP, generate_grid
from GPGO.GaussianProcess.Kernel.RBF import RBF
from GPGO.BayesOpt import BayesianOptimization
import numpy as np
import os
import argparse
def get_right_coeffs(array):
truth_index = [2, 6, 7, 9, 15, 19, 20, 30]
return np.atleast_2d(np.squeeze(array)... | true | true |
f7feb92edc8727f99dc5f12f1f7e9a016e25ed15 | 1,485 | py | Python | setup.py | AugurProject/pyethereum | e0a2edfd586d4d628e4c64c511d0ace514af44ee | [
"MIT"
] | 7 | 2017-10-12T20:26:52.000Z | 2022-03-26T19:42:35.000Z | setup.py | AugurProject/pyethereum | e0a2edfd586d4d628e4c64c511d0ace514af44ee | [
"MIT"
] | 1 | 2017-07-12T07:03:22.000Z | 2017-07-12T07:52:54.000Z | setup.py | AugurProject/pyethereum | e0a2edfd586d4d628e4c64c511d0ace514af44ee | [
"MIT"
] | 2 | 2017-08-05T18:15:36.000Z | 2018-05-17T03:00:35.000Z | from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
# requirements
install_requires = set(x.strip() for x in open('requirements.txt'))
install_requires_replacements = {
'https://github.com/ethereum/ethash/tarball/master': 'pyethash',
}
install_requi... | 29.7 | 85 | 0.682828 | from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
install_requires = set(x.strip() for x in open('requirements.txt'))
install_requires_replacements = {
'https://github.com/ethereum/ethash/tarball/master': 'pyethash',
}
install_requires = [
in... | true | true |
f7feb932e264f7dc151faba6558bd455a687d477 | 1,365 | py | Python | languages/ms.py | nursix/STL | 682d8455c8e1c761f48542dad96da08767301923 | [
"MIT"
] | 1 | 2017-11-16T14:50:19.000Z | 2017-11-16T14:50:19.000Z | languages/ms.py | vpccalderara/sahana | 6eb3f9798879dfa51bbe5d2b84829b1402671499 | [
"MIT"
] | null | null | null | languages/ms.py | vpccalderara/sahana | 6eb3f9798879dfa51bbe5d2b84829b1402671499 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
{
'Malaysian': 'Bahasa Melayu',
'agree': 'setuju',
'all of it': 'semuanya',
'Dear %(person_name)s': 'Kepada %(person_name)s',
'disagree': 'tidak setuju',
'most of it': 'kebanyakannya',
'no': 'tidak',
'no change': 'tiada perubahan',
'not at all': 'tidak sama sekali',
'part of it': 'sebahagian dar... | 56.875 | 206 | 0.738462 |
{
'Malaysian': 'Bahasa Melayu',
'agree': 'setuju',
'all of it': 'semuanya',
'Dear %(person_name)s': 'Kepada %(person_name)s',
'disagree': 'tidak setuju',
'most of it': 'kebanyakannya',
'no': 'tidak',
'no change': 'tiada perubahan',
'not at all': 'tidak sama sekali',
'part of it': 'sebahagian daripadanya',
'significant... | true | true |
f7feba3795eb81b778951d3476fcdcf2185683f7 | 38,828 | py | Python | GeoHealthCheck/app.py | dersteppenwolf/GeoHealthCheck | a1f4792dfca8f3774b4af9acd61de66a44103249 | [
"MIT"
] | null | null | null | GeoHealthCheck/app.py | dersteppenwolf/GeoHealthCheck | a1f4792dfca8f3774b4af9acd61de66a44103249 | [
"MIT"
] | null | null | null | GeoHealthCheck/app.py | dersteppenwolf/GeoHealthCheck | a1f4792dfca8f3774b4af9acd61de66a44103249 | [
"MIT"
] | null | null | null | # =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
# Just van den Broecke <justb4@gmail.com>
#
# Copyright (c) 2014 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documenta... | 35.298182 | 79 | 0.604152 |
import base64
import csv
import json
import logging
from io import StringIO
from flask import (abort, flash, g, jsonify, redirect,
render_template, request, url_for)
from flask_babel import gettext
from flask_login import (LoginManager, login_user, logout_user,
... | true | true |
f7feba68caa8e405556b6ebf1b35498ba9d47f13 | 2,462 | py | Python | src/lib/gpxpy/utils.py | jdesgats/opengpxmapper | 2164bb294ec18bd96dbf82c5db83ca28e002896f | [
"Unlicense",
"MIT"
] | 1 | 2015-03-12T11:21:17.000Z | 2015-03-12T11:21:17.000Z | src/lib/gpxpy/utils.py | jdesgats/opengpxmapper | 2164bb294ec18bd96dbf82c5db83ca28e002896f | [
"Unlicense",
"MIT"
] | null | null | null | src/lib/gpxpy/utils.py | jdesgats/opengpxmapper | 2164bb294ec18bd96dbf82c5db83ca28e002896f | [
"Unlicense",
"MIT"
] | 1 | 2021-12-25T16:46:11.000Z | 2021-12-25T16:46:11.000Z | # -*- coding: utf-8 -*-
# Copyright 2011 Tomo Krajina
#
# 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 ... | 24.376238 | 79 | 0.642973 |
import sys as mod_sys
import xml.sax.saxutils as mod_saxutils
PYTHON_VERSION = mod_sys.version.split(' ')[0]
def to_xml(tag, attributes=None, content=None, default=None, escape=False):
attributes = attributes or {}
result = '\n<%s' % tag
if content is None and default:
content = d... | true | true |
f7febaca2f57a1183dd1609bb06226e92d527c6b | 22 | py | Python | db_model/post-comment.py | UtkarshR8j/evolv-challenge | 81469c2eab27db140e2c7a369885b7e3b1584b77 | [
"MIT"
] | null | null | null | db_model/post-comment.py | UtkarshR8j/evolv-challenge | 81469c2eab27db140e2c7a369885b7e3b1584b77 | [
"MIT"
] | null | null | null | db_model/post-comment.py | UtkarshR8j/evolv-challenge | 81469c2eab27db140e2c7a369885b7e3b1584b77 | [
"MIT"
] | null | null | null | from . import crud_db
| 11 | 21 | 0.772727 | from . import crud_db
| true | true |
f7febb023cfee9a4ea9b3b7a10a95627418d1772 | 5,669 | py | Python | ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/utils.py | likenamehaojie/Apache-Ambari-ZH | 5973025bd694cdbb4b49fb4c4e0d774782811ff6 | [
"Apache-2.0"
] | 25 | 2019-12-04T03:09:55.000Z | 2022-03-08T10:52:06.000Z | ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/utils.py | likenamehaojie/Apache-Ambari-ZH | 5973025bd694cdbb4b49fb4c4e0d774782811ff6 | [
"Apache-2.0"
] | 29 | 2019-12-04T03:00:39.000Z | 2022-03-02T06:25:44.000Z | ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/utils.py | likenamehaojie/Apache-Ambari-ZH | 5973025bd694cdbb4b49fb4c4e0d774782811ff6 | [
"Apache-2.0"
] | 33 | 2019-12-04T02:51:30.000Z | 2022-03-24T02:47:38.000Z | """
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | 37.052288 | 132 | 0.709473 | import os
from resource_management import *
from resource_management.libraries.functions.check_process_status import wait_process_stopped
import re
def service(action=None, name=None, user=None, create_pid_dir=False,
create_log_dir=False):
import params
pid_dir = format("{hadoop_pid_dir_prefix}/{use... | true | true |
f7febb8e588e9195aa2a3c12f5179b386a0c0bf6 | 2,217 | py | Python | graffiti/user_ns.py | rbardaji/graffiti | e10490a58b7eff041ff8212784f05daa076e3f53 | [
"MIT"
] | null | null | null | graffiti/user_ns.py | rbardaji/graffiti | e10490a58b7eff041ff8212784f05daa076e3f53 | [
"MIT"
] | null | null | null | graffiti/user_ns.py | rbardaji/graffiti | e10490a58b7eff041ff8212784f05daa076e3f53 | [
"MIT"
] | null | null | null | from flask_restx import Namespace, Resource, fields
from flask import request
from .utils.db_manager import get_query_id, get_query
from .utils.auth_manager import get_token, get_token_info
from .utils.decorator import token_required
api = Namespace('user',
description='Get an Authorization Token and ... | 32.130435 | 78 | 0.684258 | from flask_restx import Namespace, Resource, fields
from flask import request
from .utils.db_manager import get_query_id, get_query
from .utils.auth_manager import get_token, get_token_info
from .utils.decorator import token_required
api = Namespace('user',
description='Get an Authorization Token and ... | true | true |
f7febd36d05a871c6e97fd490bf41a5eb13551e3 | 862 | py | Python | zerver/migrations/0087_remove_old_scheduled_jobs.py | pranayshahxyz/zulip | 3da483487af79fde9dce2d21124dfa39b94936a5 | [
"Apache-2.0"
] | 1 | 2020-04-09T18:34:44.000Z | 2020-04-09T18:34:44.000Z | zerver/migrations/0087_remove_old_scheduled_jobs.py | pranayshahxyz/zulip | 3da483487af79fde9dce2d21124dfa39b94936a5 | [
"Apache-2.0"
] | null | null | null | zerver/migrations/0087_remove_old_scheduled_jobs.py | pranayshahxyz/zulip | 3da483487af79fde9dce2d21124dfa39b94936a5 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 1.10.5 on 2017-05-10 05:59
from django.db import migrations
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
def delete_old_scheduled_jobs(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
"""Delete a... | 34.48 | 92 | 0.74478 |
from django.db import migrations
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
def delete_old_scheduled_jobs(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
ScheduledJob = apps.get_model('zerver', 'ScheduledJob')
... | true | true |
f7febdd608474fa96a7f7b00850d15a79ef14c7a | 3,019 | py | Python | src/fever_cs.py | aic-factcheck/fever-cs-baseline | 8f1721fdecb3c1aa226a1c4c0458f7e3a3166250 | [
"MIT"
] | null | null | null | src/fever_cs.py | aic-factcheck/fever-cs-baseline | 8f1721fdecb3c1aa226a1c4c0458f7e3a3166250 | [
"MIT"
] | null | null | null | src/fever_cs.py | aic-factcheck/fever-cs-baseline | 8f1721fdecb3c1aa226a1c4c0458f7e3a3166250 | [
"MIT"
] | null | null | null | import json
from logging.config import dictConfig
from typing import List, Dict
from allennlp.models import load_archive
from allennlp.predictors import Predictor
from fever.api.web_server import fever_web_api
from fever.evidence.retrieval_methods.retrieval_method import RetrievalMethod
import os
import logging
from f... | 37.7375 | 110 | 0.627691 | import json
from logging.config import dictConfig
from typing import List, Dict
from allennlp.models import load_archive
from allennlp.predictors import Predictor
from fever.api.web_server import fever_web_api
from fever.evidence.retrieval_methods.retrieval_method import RetrievalMethod
import os
import logging
from f... | true | true |
f7febe073fcf8ad7273e7569a5ed882fdc4e8ef5 | 5,463 | py | Python | blazar/plugins/devices/zun_plugin.py | 4sarathbabu/blazar | 16ed6ad588e3508d1436aa3b2f1aae4ed5f4928b | [
"Apache-2.0"
] | 1 | 2022-02-22T11:34:45.000Z | 2022-02-22T11:34:45.000Z | blazar/plugins/devices/zun_plugin.py | 4sarathbabu/blazar | 16ed6ad588e3508d1436aa3b2f1aae4ed5f4928b | [
"Apache-2.0"
] | 19 | 2017-05-23T21:34:09.000Z | 2022-02-21T19:15:29.000Z | blazar/plugins/devices/zun_plugin.py | 4sarathbabu/blazar | 16ed6ad588e3508d1436aa3b2f1aae4ed5f4928b | [
"Apache-2.0"
] | 4 | 2018-08-20T19:39:02.000Z | 2022-02-22T11:36:39.000Z | # -*- coding: utf-8 -*-
#
# Author: Pierre Riteau <pierre@stackhpc.com>
#
# 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 a... | 39.586957 | 79 | 0.615596 |
from oslo_config import cfg
from blazar.db import api as db_api
from blazar.db import exceptions as db_ex
from blazar.manager import exceptions as manager_ex
from blazar.utils.openstack import placement
from blazar.utils.openstack import zun
from oslo_log import log as logging
from zunclient import exce... | true | true |
f7fec0553288fad8f505cc07198fe4784885fdf5 | 7,963 | py | Python | Providers/nxOMSAutomationWorker/automationworker/3.x/worker/sandbox.py | Microsoft/PowerShell-DSC-for-Linux | 286aa5f66ca3c70148c4afb03b7e7c40de0d44af | [
"MIT"
] | 154 | 2015-11-25T13:30:23.000Z | 2019-04-30T17:12:24.000Z | Providers/nxOMSAutomationWorker/automationworker/3.x/worker/sandbox.py | Microsoft/PowerShell-DSC-for-Linux | 286aa5f66ca3c70148c4afb03b7e7c40de0d44af | [
"MIT"
] | 317 | 2015-12-04T17:19:49.000Z | 2019-04-19T15:26:34.000Z | Providers/nxOMSAutomationWorker/automationworker/3.x/worker/sandbox.py | Microsoft/PowerShell-DSC-for-Linux | 286aa5f66ca3c70148c4afb03b7e7c40de0d44af | [
"MIT"
] | 72 | 2015-11-23T03:02:15.000Z | 2019-04-17T14:45:39.000Z | #!/usr/bin/env python3
# ====================================
# Copyright (c) Microsoft Corporation. All rights reserved.
# ====================================
"""Sandbox module."""
import os
import sys
import time
import traceback
from queue import Queue, Empty
import util
# append worker binary source path
sys.p... | 41.046392 | 135 | 0.658295 |
import os
import sys
import time
import traceback
from queue import Queue, Empty
import util
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
util.add_all_packages_under_automationworker_to_sys_path()
import configuration3 as configuration
import tracer
from automationconstants impo... | true | true |
f7fec056b4ec04a2de2b3bb684da35f7774d20e1 | 1,706 | py | Python | profiles_api/migrations/0001_initial.py | anilchoudhary/profiles-rest-api | fcd0f9756e0f7df8a39e265d100f0e4b05884fe7 | [
"MIT"
] | null | null | null | profiles_api/migrations/0001_initial.py | anilchoudhary/profiles-rest-api | fcd0f9756e0f7df8a39e265d100f0e4b05884fe7 | [
"MIT"
] | 7 | 2020-06-06T01:33:27.000Z | 2022-02-10T15:12:50.000Z | profiles_api/migrations/0001_initial.py | anilchoudhary/profiles-rest-api | fcd0f9756e0f7df8a39e265d100f0e4b05884fe7 | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2020-03-23 05:19
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='UserProfile',
... | 50.176471 | 266 | 0.638921 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='UserProfile',
fields=[
('id', models.Au... | true | true |
f7fec1f1fd5647f172d22cfb001806a0622e0bc3 | 1,793 | py | Python | robot-server/robot_server/health/router.py | knownmed/opentrons | d02eb3c6cbf9f1c8c05c5e9e1dac30a92a8c5e6c | [
"Apache-2.0"
] | 235 | 2017-10-27T20:37:27.000Z | 2022-03-30T14:09:49.000Z | robot-server/robot_server/health/router.py | knownmed/opentrons | d02eb3c6cbf9f1c8c05c5e9e1dac30a92a8c5e6c | [
"Apache-2.0"
] | 8,425 | 2017-10-26T15:25:43.000Z | 2022-03-31T23:54:26.000Z | robot-server/robot_server/health/router.py | knownmed/opentrons | d02eb3c6cbf9f1c8c05c5e9e1dac30a92a8c5e6c | [
"Apache-2.0"
] | 130 | 2017-11-09T21:02:37.000Z | 2022-03-15T18:01:24.000Z | """HTTP routes and handlers for /health endpoints."""
from fastapi import APIRouter, Depends, status
from opentrons import __version__, config, protocol_api
from opentrons.hardware_control import API as HardwareAPI
from robot_server.hardware import get_hardware
from robot_server.service.legacy.models import V1BasicRe... | 33.203704 | 78 | 0.697156 | from fastapi import APIRouter, Depends, status
from opentrons import __version__, config, protocol_api
from opentrons.hardware_control import API as HardwareAPI
from robot_server.hardware import get_hardware
from robot_server.service.legacy.models import V1BasicResponse
from .models import Health, HealthLinks
LOG_P... | true | true |
f7fec20f25cc85ade8c079bffb0d1757f3ad0bab | 779 | py | Python | belvo/resources/incomes.py | ejimz/belvo-python | 2eb1eb385946baef47ca596634cbc5ec2183b606 | [
"MIT"
] | 14 | 2020-04-04T05:02:32.000Z | 2022-03-14T02:08:48.000Z | belvo/resources/incomes.py | ejimz/belvo-python | 2eb1eb385946baef47ca596634cbc5ec2183b606 | [
"MIT"
] | 122 | 2019-11-18T09:20:52.000Z | 2022-03-01T15:38:13.000Z | belvo/resources/incomes.py | ejimz/belvo-python | 2eb1eb385946baef47ca596634cbc5ec2183b606 | [
"MIT"
] | 11 | 2020-01-18T00:41:01.000Z | 2022-01-26T20:52:53.000Z | from typing import Dict, List, Union
from belvo.resources.base import Resource
class Incomes(Resource):
endpoint = "/api/incomes/"
def create(
self,
link: str,
*,
token: str = None,
save_data: bool = True,
date_from: str = None,
date_to: str = None,
... | 23.606061 | 79 | 0.563543 | from typing import Dict, List, Union
from belvo.resources.base import Resource
class Incomes(Resource):
endpoint = "/api/incomes/"
def create(
self,
link: str,
*,
token: str = None,
save_data: bool = True,
date_from: str = None,
date_to: str = None,
... | true | true |
f7fec32b9ee150c6800dd136bb3b93d98a0e64ed | 398 | py | Python | app/core/urls.py | nyyirs/profiles-rest-api | b3c270e20e4d9503dd8ab2d533c56995c49f3560 | [
"MIT"
] | null | null | null | app/core/urls.py | nyyirs/profiles-rest-api | b3c270e20e4d9503dd8ab2d533c56995c49f3560 | [
"MIT"
] | null | null | null | app/core/urls.py | nyyirs/profiles-rest-api | b3c270e20e4d9503dd8ab2d533c56995c49f3560 | [
"MIT"
] | null | null | null | from django.urls import include, path
from . import views
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register('profile', views.UserProfileViewSet)
router.register('feed', views.UserProfileFeedViewSet)
urlpatterns = [
path('hello/', views.HelloApiView.as_view()),
path('log... | 28.428571 | 53 | 0.753769 | from django.urls import include, path
from . import views
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register('profile', views.UserProfileViewSet)
router.register('feed', views.UserProfileFeedViewSet)
urlpatterns = [
path('hello/', views.HelloApiView.as_view()),
path('log... | true | true |
f7fec3693b5e645595012d950293121f9175c155 | 550 | py | Python | env/Lib/site-packages/plotly/validators/scatter/marker/line/_coloraxis.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/Lib/site-packages/plotly/validators/scatter/marker/line/_coloraxis.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/Lib/site-packages/plotly/validators/scatter/marker/line/_coloraxis.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class ColoraxisValidator(_plotly_utils.basevalidators.SubplotidValidator):
def __init__(
self, plotly_name="coloraxis", parent_name="scatter.marker.line", **kwargs
):
super(ColoraxisValidator, self).__init__(
plotly_name=plotly_name,
... | 34.375 | 82 | 0.62 | import _plotly_utils.basevalidators
class ColoraxisValidator(_plotly_utils.basevalidators.SubplotidValidator):
def __init__(
self, plotly_name="coloraxis", parent_name="scatter.marker.line", **kwargs
):
super(ColoraxisValidator, self).__init__(
plotly_name=plotly_name,
... | true | true |
f7fec39a0c172b0c6ce55288297ae45c020fb8f5 | 1,329 | py | Python | monk/system_unit_tests/pytorch/test_loss_l1.py | take2rohit/monk_v1 | 9c567bf2c8b571021b120d879ba9edf7751b9f92 | [
"Apache-2.0"
] | 542 | 2019-11-10T12:09:31.000Z | 2022-03-28T11:39:07.000Z | monk/system_unit_tests/pytorch/test_loss_l1.py | take2rohit/monk_v1 | 9c567bf2c8b571021b120d879ba9edf7751b9f92 | [
"Apache-2.0"
] | 117 | 2019-11-12T09:39:24.000Z | 2022-03-12T00:20:41.000Z | monk/system_unit_tests/pytorch/test_loss_l1.py | take2rohit/monk_v1 | 9c567bf2c8b571021b120d879ba9edf7751b9f92 | [
"Apache-2.0"
] | 246 | 2019-11-09T21:53:24.000Z | 2022-03-29T00:57:07.000Z | import os
import sys
sys.path.append("../../../../monk_v1/");
sys.path.append("../../../monk/");
import psutil
from pytorch_prototype import prototype
from compare_prototype import compare
from common import print_start
from common import print_status
import torch
import numpy as np
from pytorch.losses.return_loss im... | 26.58 | 69 | 0.616253 | import os
import sys
sys.path.append("../../../../monk_v1/");
sys.path.append("../../../monk/");
import psutil
from pytorch_prototype import prototype
from compare_prototype import compare
from common import print_start
from common import print_status
import torch
import numpy as np
from pytorch.losses.return_loss im... | true | true |
f7fec44e09a5e8cca9f453026f91743bdebfc047 | 13,924 | py | Python | log_casp_inh/model_733.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_casp_inh/model_733.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_casp_inh/model_733.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('C6A', ['C8pro'])
Monomer('BaxA', ['BaxM', 'BaxA_1', 'BaxA_2', 'SmacM'])
Monomer('Ligand', ['Receptor'])
Monomer('C6pro', ['C3A'])
Monome... | 85.423313 | 598 | 0.808532 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('C6A', ['C8pro'])
Monomer('BaxA', ['BaxM', 'BaxA_1', 'BaxA_2', 'SmacM'])
Monomer('Ligand', ['Receptor'])
Monomer('C6pro', ['C3A'])
Monomer('ParpU', ['C3A'])
Monomer('BidU'... | true | true |
f7fec4a9a2aff4634507fdcd8b997b292d49c8ea | 8,445 | py | Python | fixtures/contact.py | Stabilniy/python_training | b3495595445a80e408ad2a4a33536166259655f3 | [
"Apache-2.0"
] | 1 | 2020-04-27T12:11:51.000Z | 2020-04-27T12:11:51.000Z | fixtures/contact.py | Stabilniy/python_training | b3495595445a80e408ad2a4a33536166259655f3 | [
"Apache-2.0"
] | null | null | null | fixtures/contact.py | Stabilniy/python_training | b3495595445a80e408ad2a4a33536166259655f3 | [
"Apache-2.0"
] | null | null | null | from selenium.webdriver.support.ui import Select
import time
from modules.contact import Contact
class ContactHelper:
def __init__(self, app):
self.app = app
def new_contact_creation(self, contact):
wd = self.app.wd
wd.find_element_by_link_text("add new").click()
self.fill_cont... | 45.403226 | 195 | 0.65743 | from selenium.webdriver.support.ui import Select
import time
from modules.contact import Contact
class ContactHelper:
def __init__(self, app):
self.app = app
def new_contact_creation(self, contact):
wd = self.app.wd
wd.find_element_by_link_text("add new").click()
self.fill_cont... | true | true |
f7fec4ce0c2338c3018a4398ae64a4d387d55a5a | 1,083 | py | Python | rplugin/python3/deoplete/filter/matcher_full_fuzzy.py | kazufusa/deoplete.nvim | e61b8faee0b07f837f9009d780cbc3c2caaef76a | [
"MIT"
] | 10 | 2020-07-21T21:59:54.000Z | 2021-07-19T11:01:47.000Z | rplugin/python3/deoplete/filter/matcher_full_fuzzy.py | kazufusa/deoplete.nvim | e61b8faee0b07f837f9009d780cbc3c2caaef76a | [
"MIT"
] | 4 | 2017-04-15T17:45:36.000Z | 2017-11-20T16:27:17.000Z | rplugin/python3/deoplete/filter/matcher_full_fuzzy.py | kazufusa/deoplete.nvim | e61b8faee0b07f837f9009d780cbc3c2caaef76a | [
"MIT"
] | 1 | 2021-07-17T18:51:40.000Z | 2021-07-17T18:51:40.000Z | # ============================================================================
# FILE: matcher_full_fuzzy.py
# AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
# License: MIT license
# ============================================================================
import re
from deoplete.base.filter import Base
from... | 34.935484 | 78 | 0.538319 |
import re
from deoplete.base.filter import Base
from deoplete.util import fuzzy_escape, Nvim, UserContext, Candidates
class Filter(Base):
def __init__(self, vim: Nvim) -> None:
super().__init__(vim)
self.name = 'matcher_full_fuzzy'
self.description = 'full fuzzy matcher'
def f... | true | true |
f7fec5036b94158de10bbd0ac3ca8c077be9ea5f | 10,200 | py | Python | utils/networks/network_si_pathint.py | ashishgaurav13/cl_safer_classifiers | a3df87a4bc863377485fa58a8a475991a4fc9800 | [
"MIT"
] | 1 | 2020-07-03T06:51:19.000Z | 2020-07-03T06:51:19.000Z | utils/networks/network_si_pathint.py | ashishgaurav13/cl_safer_classifiers | a3df87a4bc863377485fa58a8a475991a4fc9800 | [
"MIT"
] | 3 | 2021-06-08T20:55:17.000Z | 2022-03-12T00:14:23.000Z | utils/networks/network_si_pathint.py | ashishgaurav13/cl_safer_classifiers | a3df87a4bc863377485fa58a8a475991a4fc9800 | [
"MIT"
] | null | null | null | import os, sys
sys.path.extend([os.path.expanduser(
os.path.abspath('./utils/networks/synaptic_intelligence/')
)])
from pathint import utils as putils
import utils
from keras.models import Sequential
from keras.layers import Dense, Dropout
from pathint import protocols
from pathint.optimizers import KOOptimizer
fro... | 39.534884 | 114 | 0.582941 | import os, sys
sys.path.extend([os.path.expanduser(
os.path.abspath('./utils/networks/synaptic_intelligence/')
)])
from pathint import utils as putils
import utils
from keras.models import Sequential
from keras.layers import Dense, Dropout
from pathint import protocols
from pathint.optimizers import KOOptimizer
fro... | true | true |
f7fec56a2cca9fae95f9dcd0679592c38398cd18 | 4,507 | py | Python | sisyphus/models.py | bpotvin-bccrc/colossus | fa5ca7ce4cfe794c7d2167acb868aa9167988941 | [
"MIT"
] | 2 | 2018-10-03T16:05:14.000Z | 2019-03-08T23:01:29.000Z | sisyphus/models.py | bpotvin-bccrc/colossus | fa5ca7ce4cfe794c7d2167acb868aa9167988941 | [
"MIT"
] | 3 | 2019-05-09T22:48:22.000Z | 2020-06-05T18:52:05.000Z | sisyphus/models.py | bpotvin-bccrc/colossus | fa5ca7ce4cfe794c7d2167acb868aa9167988941 | [
"MIT"
] | 4 | 2018-08-16T22:25:10.000Z | 2021-02-19T16:10:15.000Z | """
Created on July 6, 2017
@author: Jessica Ngo (jngo@bccrc.ca)
"""
from __future__ import unicode_literals
import datetime
#============================
# Django imports
#----------------------------
from django.db import models
from django.utils import timezone
from django.core.urlresolvers import reverse
from dja... | 24.494565 | 99 | 0.643665 |
from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils import timezone
from django.core.urlresolvers import reverse
from django.contrib.postgres.fields import JSONField
from simple_history.models import HistoricalRecords
from dlp.models import *
from tenx.models ... | true | true |
f7fec5e7f96c3a35e2ad6fe5196f1c876615d155 | 16,355 | py | Python | django/utils/feedgenerator.py | pomarec/django | 98514849dce07acfaa224a90a784bba9d97249e5 | [
"BSD-3-Clause"
] | 1 | 2015-06-14T07:55:29.000Z | 2015-06-14T07:55:29.000Z | django/utils/feedgenerator.py | pomarec/django | 98514849dce07acfaa224a90a784bba9d97249e5 | [
"BSD-3-Clause"
] | null | null | null | django/utils/feedgenerator.py | pomarec/django | 98514849dce07acfaa224a90a784bba9d97249e5 | [
"BSD-3-Clause"
] | null | null | null | """
Syndication feed generation library -- used for generating RSS, etc.
Sample usage:
>>> from django.utils import feedgenerator
>>> feed = feedgenerator.Rss201rev2Feed(
... title="Poynter E-Media Tidbits",
... link="http://www.poynter.org/column.asp?id=31",
... description="A group Weblog by the sharpes... | 40.68408 | 120 | 0.614063 | from __future__ import unicode_literals
import datetime
from django.utils.xmlutils import SimplerXMLGenerator
from django.utils.encoding import force_text, iri_to_uri
from django.utils import datetime_safe
from django.utils import six
from django.utils.six import StringIO
from django.utils.six.moves.urllib.parse impor... | true | true |
f7fec803968bd1900ec2a92cb4c56d39eae63cb3 | 627 | py | Python | tests/models.py | octue/django-gcp | fedc5506e57e799e76b9876696cbdf172ba19e16 | [
"MIT"
] | null | null | null | tests/models.py | octue/django-gcp | fedc5506e57e799e76b9876696cbdf172ba19e16 | [
"MIT"
] | 4 | 2022-02-07T00:10:44.000Z | 2022-02-10T17:03:37.000Z | tests/models.py | octue/django-gcp | fedc5506e57e799e76b9876696cbdf172ba19e16 | [
"MIT"
] | null | null | null | from django.db.models import CharField
from django_gcp.models import MyAbstractModel
class Armadillo(MyAbstractModel):
"""
This is how you test abstract classes in your library without adding concrete models: add the concrete model
to your test app. You'll need to make the migrations for the test app:
... | 29.857143 | 112 | 0.701754 | from django.db.models import CharField
from django_gcp.models import MyAbstractModel
class Armadillo(MyAbstractModel):
name = CharField(max_length=32)
class Meta:
app_label = "tests"
def __str__(self):
return super(Armadillo, self).__str__() + f' ("{self.name}")'
| true | true |
f7fec8ff461f5da9b1641bb51f45c8ff7f2c9f1f | 3,303 | py | Python | isi_sdk/models/ntp_server.py | Atomicology/isilon_sdk_python | 91039da803ae37ed4abf8d2a3f59c333f3ef1866 | [
"MIT"
] | null | null | null | isi_sdk/models/ntp_server.py | Atomicology/isilon_sdk_python | 91039da803ae37ed4abf8d2a3f59c333f3ef1866 | [
"MIT"
] | null | null | null | isi_sdk/models/ntp_server.py | Atomicology/isilon_sdk_python | 91039da803ae37ed4abf8d2a3f59c333f3ef1866 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Copyright 2016 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | 26.853659 | 77 | 0.549198 |
from pprint import pformat
from six import iteritems
import re
class NtpServer(object):
def __init__(self):
self.swagger_types = {
'key': 'str'
}
self.attribute_map = {
'key': 'key'
}
self._key = None
@property
def key(self):
re... | true | true |
f7fec93bbeedace372bec5fec4f6f3e8e3ddd53e | 171,648 | py | Python | tensorflow/python/data/ops/dataset_ops.py | leike666666/tensorflow | a3fd0ddfcb716be124e95b51e96e6c1e4507ef64 | [
"Apache-2.0"
] | 2 | 2020-09-27T16:51:58.000Z | 2020-10-22T06:16:29.000Z | tensorflow/python/data/ops/dataset_ops.py | leike666666/tensorflow | a3fd0ddfcb716be124e95b51e96e6c1e4507ef64 | [
"Apache-2.0"
] | 2 | 2021-08-25T15:57:35.000Z | 2022-02-10T01:09:32.000Z | tensorflow/python/data/ops/dataset_ops.py | leike666666/tensorflow | a3fd0ddfcb716be124e95b51e96e6c1e4507ef64 | [
"Apache-2.0"
] | 1 | 2020-04-22T01:47:46.000Z | 2020-04-22T01:47:46.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.862517 | 116 | 0.688776 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
import functools
import sys
import threading
import warnings
import weakref
import numpy as np
import six
from six.moves import queue as Queue
from tensorflow.core.framework import ... | true | true |
f7feca1319ebf62bf200c532c66dfe16f40e28fc | 1,927 | py | Python | Tutorial code/Week 3_Pandas tutorial.py | Leanneliansong1/inf1340-programmingfordatascience-fa21 | 8944d019f64f9f25e7b10dafbca18250bf12e9ee | [
"MIT"
] | 8 | 2021-09-15T20:29:21.000Z | 2021-12-18T13:01:04.000Z | Tutorial code/Week 3_Pandas tutorial.py | Leanneliansong1/inf1340-programmingfordatascience-fa21 | 8944d019f64f9f25e7b10dafbca18250bf12e9ee | [
"MIT"
] | 8 | 2021-11-21T02:53:43.000Z | 2021-12-18T04:43:57.000Z | Tutorial code/Week 3_Pandas tutorial.py | Leanneliansong1/inf1340-programmingfordatascience-fa21 | 8944d019f64f9f25e7b10dafbca18250bf12e9ee | [
"MIT"
] | 44 | 2021-09-29T02:29:41.000Z | 2021-12-18T04:22:10.000Z | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
# In[3]:
df = pd.read_csv('merc.csv')
# In[4]:
print(df.head(10))
# In[47]:
print(df.head())
# In[48]:
print(df.tail())
# In[49]:
print(df.info())
# In[50]:
#refer to the row index:
print(df.loc[0])
# In[54]:
print(df.lo... | 8.526549 | 60 | 0.553191 |
import pandas as pd
df = pd.read_csv('merc.csv')
print(df.head(10))
print(df.head())
print(df.tail())
print(df.info())
print(df.loc[0])
print(df.loc[[3, 9]])
print(df.loc[2])
print(df.loc[[0, 1]])
print(df.duplicated())
df.drop_duplicates(inplace = True... | true | true |
f7fecb00e6bc3e6e0a15eac5efa706c14db730b6 | 65,651 | py | Python | test/integration/component/test_resource_limits.py | ke4qqq/cloudstack | 7e0f1cf4571f9c3f6c26b8d744d2ed102fa7a511 | [
"Apache-2.0"
] | 1 | 2015-02-06T04:17:11.000Z | 2015-02-06T04:17:11.000Z | test/integration/component/test_resource_limits.py | ke4qqq/cloudstack | 7e0f1cf4571f9c3f6c26b8d744d2ed102fa7a511 | [
"Apache-2.0"
] | 6 | 2020-11-16T20:44:23.000Z | 2022-02-01T01:06:16.000Z | test/integration/component/test_resource_limits.py | ke4qqq/cloudstack | 7e0f1cf4571f9c3f6c26b8d744d2ed102fa7a511 | [
"Apache-2.0"
] | 15 | 2017-01-12T11:17:48.000Z | 2019-04-19T10:09:31.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 43.913712 | 128 | 0.424974 |
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.lib.base import (VirtualMachine,
Snapshot,
Template,
PublicIPAddress,
... | true | true |
f7fecb5dd903ced38507ad507a79c61876dcae62 | 288 | py | Python | server/forms/complete_task.py | andrewdstrain/Tasky | 605483a709e9d6e964d5e84d6e571d143315b933 | [
"BSD-2-Clause"
] | null | null | null | server/forms/complete_task.py | andrewdstrain/Tasky | 605483a709e9d6e964d5e84d6e571d143315b933 | [
"BSD-2-Clause"
] | null | null | null | server/forms/complete_task.py | andrewdstrain/Tasky | 605483a709e9d6e964d5e84d6e571d143315b933 | [
"BSD-2-Clause"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import SubmitField, SelectField
class CompleteTaskForm(FlaskForm):
"""
A Flask form for completing a task
"""
task_id = SelectField('Select Task That Is Complete: ', coerce=int)
submit = SubmitField("Mark Task Complete")
| 26.181818 | 71 | 0.725694 | from flask_wtf import FlaskForm
from wtforms import SubmitField, SelectField
class CompleteTaskForm(FlaskForm):
task_id = SelectField('Select Task That Is Complete: ', coerce=int)
submit = SubmitField("Mark Task Complete")
| true | true |
f7fecbcb14a461a742829a7c14154173528c47e1 | 741 | py | Python | Day-109/subtract_prod_sum.py | arvimal/100DaysofCode-Python | 01e59f45b4dc06a3be9e9900456a6bd439752911 | [
"MIT"
] | 1 | 2020-06-15T05:59:01.000Z | 2020-06-15T05:59:01.000Z | Day-109/subtract_prod_sum.py | arvimal/100DaysofCode-Python | 01e59f45b4dc06a3be9e9900456a6bd439752911 | [
"MIT"
] | null | null | null | Day-109/subtract_prod_sum.py | arvimal/100DaysofCode-Python | 01e59f45b4dc06a3be9e9900456a6bd439752911 | [
"MIT"
] | 7 | 2020-01-24T23:03:58.000Z | 2021-05-31T01:00:27.000Z |
"""
* Initial submssion
class Solution:
def subtractProductAndSum(self, n: int) -> int:
num_list = []
for num in str(n):
num_list.append(int(num))
sum_num = sum(num_list)
prod_num = 1
for i in num_list:
prod_num = prod_num * i
print(prod_num ... | 23.903226 | 51 | 0.59919 |
class Solution:
def subtractProductAndSum(self, n: int) -> int:
num_list = [int(num) for num in str(n)]
sum_num = sum(num_list)
prod_num = 1
for i in num_list:
prod_num *= i
return prod_num - sum_num
Test = Solution()
Test.subtractProductAndSum(124)
Test.subtra... | true | true |
f7fecc38168cd8e8e5783799cf074aa8927d8b9f | 16,670 | py | Python | otl.py | allenjhuang/otl_timecard | 474e26e6ee561d795245462f640504bc112f3e00 | [
"MIT"
] | null | null | null | otl.py | allenjhuang/otl_timecard | 474e26e6ee561d795245462f640504bc112f3e00 | [
"MIT"
] | null | null | null | otl.py | allenjhuang/otl_timecard | 474e26e6ee561d795245462f640504bc112f3e00 | [
"MIT"
] | null | null | null | from __future__ import annotations
import constants
import selenium_extras.additional_expected_conditions as AdditionalEC
from selenium_extras.additional_exceptions import (
IncorrectLoginDetails, MaxTriesReached, SubtaskNotFound
)
from selenium_extras.wrapper import Browser
from utils import log_wrap
i... | 42.74359 | 80 | 0.566407 | from __future__ import annotations
import constants
import selenium_extras.additional_expected_conditions as AdditionalEC
from selenium_extras.additional_exceptions import (
IncorrectLoginDetails, MaxTriesReached, SubtaskNotFound
)
from selenium_extras.wrapper import Browser
from utils import log_wrap
i... | true | true |
f7fecd139876716900add92c19f29a1441b59c06 | 67,206 | py | Python | tests/test_wrappers.py | saleweaver/python-amazon-mws | a6d58fbcb0543b48f462184f86671fcafc55b194 | [
"Unlicense"
] | null | null | null | tests/test_wrappers.py | saleweaver/python-amazon-mws | a6d58fbcb0543b48f462184f86671fcafc55b194 | [
"Unlicense"
] | null | null | null | tests/test_wrappers.py | saleweaver/python-amazon-mws | a6d58fbcb0543b48f462184f86671fcafc55b194 | [
"Unlicense"
] | null | null | null | import pytest
import xmltodict
from mws.mws import DataWrapper, DictWrapper, MWSError
def test_content_md5_comparison():
data = b'abc\tdef'
hash = 'Zj+Bh1BJ8HzBb9ToK28qFQ=='
DataWrapper(data, {'content-md5': hash})
def test_content_md5_check_raises_exception_if_fails():
data = b'abc\tdef'
hash ... | 2,100.1875 | 22,724 | 0.733789 | import pytest
import xmltodict
from mws.mws import DataWrapper, DictWrapper, MWSError
def test_content_md5_comparison():
data = b'abc\tdef'
hash = 'Zj+Bh1BJ8HzBb9ToK28qFQ=='
DataWrapper(data, {'content-md5': hash})
def test_content_md5_check_raises_exception_if_fails():
data = b'abc\tdef'
hash ... | true | true |
f7fecd44c586cbe798fb78a4150b7d767a8f21e1 | 44 | py | Python | golf/__init__.py | pincoin/withthai-chatbot | 7ce71c84fcc38c40ecb7df283d30e5ec2315ecd2 | [
"MIT"
] | 1 | 2020-09-20T10:09:02.000Z | 2020-09-20T10:09:02.000Z | golf/__init__.py | pincoin/withthai-chatbot | 7ce71c84fcc38c40ecb7df283d30e5ec2315ecd2 | [
"MIT"
] | 7 | 2021-04-08T19:39:58.000Z | 2022-03-12T00:48:17.000Z | golf/__init__.py | pincoin/withthai | 73d7c6aedf79883c3bd44d7944746b53f8eb110e | [
"MIT"
] | null | null | null | default_app_config = 'golf.apps.GolfConfig'
| 22 | 43 | 0.818182 | default_app_config = 'golf.apps.GolfConfig'
| true | true |
f7fecd9cf3017c7f85b5204165d11ff0f1364596 | 1,506 | py | Python | tests/util/test_stringutils.py | phiberoptick/synapse | c1ddbbde4fb948cf740d4c59869157943d3711c6 | [
"Apache-2.0"
] | null | null | null | tests/util/test_stringutils.py | phiberoptick/synapse | c1ddbbde4fb948cf740d4c59869157943d3711c6 | [
"Apache-2.0"
] | 1 | 2021-05-13T17:27:16.000Z | 2021-05-19T14:38:32.000Z | tests/util/test_stringutils.py | phiberoptick/synapse | c1ddbbde4fb948cf740d4c59869157943d3711c6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The Matrix.org Foundation C.I.C.
#
# 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... | 31.375 | 75 | 0.624834 |
from synapse.api.errors import SynapseError
from synapse.util.stringutils import assert_valid_client_secret
from .. import unittest
class StringUtilsTestCase(unittest.TestCase):
def test_client_secret_regex(self):
good = [
"abcde12345",
"ABCabc123",
"_--s... | true | true |
f7fecfc4aed022686aed6218eed432ea2542554b | 2,216 | py | Python | tests_sql/test_sql_interestingness.py | cclauss/lux | bcb9b3d56a3fc560a5d86ae5aa747c58935241c4 | [
"Apache-2.0"
] | 3,731 | 2020-01-16T01:06:30.000Z | 2022-03-31T21:01:04.000Z | tests_sql/test_sql_interestingness.py | cclauss/lux | bcb9b3d56a3fc560a5d86ae5aa747c58935241c4 | [
"Apache-2.0"
] | 393 | 2020-01-29T04:52:27.000Z | 2022-03-31T20:02:19.000Z | tests_sql/test_sql_interestingness.py | cclauss/lux | bcb9b3d56a3fc560a5d86ae5aa747c58935241c4 | [
"Apache-2.0"
] | 304 | 2020-01-29T03:00:50.000Z | 2022-03-25T22:31:20.000Z | # Copyright 2019-2020 The Lux Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 30.777778 | 87 | 0.679603 |
from .context import lux
import pytest
import pandas as pd
import numpy as np
import psycopg2
from lux.interestingness.interestingness import interestingness
def test_interestingness_1_0_1(global_var):
tbl = lux.LuxSQLTable()
tbl.set_SQL_table("cars")
tbl.set_intent(
[
l... | true | true |
f7fecffa8949305853621ce7e29517a3bd41f663 | 2,101 | py | Python | src/datashare/setup.py | zjpjack/azure-cli-extensions | 17dd637317633ea7984e168900bdf4e62c265096 | [
"MIT"
] | 1 | 2022-02-18T00:16:47.000Z | 2022-02-18T00:16:47.000Z | src/datashare/setup.py | zjpjack/azure-cli-extensions | 17dd637317633ea7984e168900bdf4e62c265096 | [
"MIT"
] | null | null | null | src/datashare/setup.py | zjpjack/azure-cli-extensions | 17dd637317633ea7984e168900bdf4e62c265096 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ----------------------------------------... | 36.224138 | 95 | 0.625892 |
from codecs import open
from setuptools import setup, find_packages
try:
from azure_bdist_wheel import cmdclass
except ImportError:
from distutils import log as logger
logger.warn("Wheel is not available, disabling bdist_wheel hook")
VERSION = '0.1.1'
CLASSIFIERS = [
'Develop... | true | true |
f7fed01b22cb381dde6d5baead29e224e7de51d3 | 1,200 | py | Python | crash_course/ch09/exec/ice_cream_stand.py | dantin/python-by-example | 5769c7a332ebd60fd54e477b6813f2f2a0f3f37f | [
"BSD-3-Clause"
] | null | null | null | crash_course/ch09/exec/ice_cream_stand.py | dantin/python-by-example | 5769c7a332ebd60fd54e477b6813f2f2a0f3f37f | [
"BSD-3-Clause"
] | null | null | null | crash_course/ch09/exec/ice_cream_stand.py | dantin/python-by-example | 5769c7a332ebd60fd54e477b6813f2f2a0f3f37f | [
"BSD-3-Clause"
] | null | null | null |
class Restaurant():
"""A simple Restaurant class."""
def __init__(self, name, cuisine_type):
"""Initialize restaurant name and cuisine type attributes."""
self.restaurant_name = name
self.cuisine_type = cuisine_type
def describe_restaurant(self):
"""Print restaurant descri... | 30.769231 | 84 | 0.635833 |
class Restaurant():
def __init__(self, name, cuisine_type):
self.restaurant_name = name
self.cuisine_type = cuisine_type
def describe_restaurant(self):
print(self.restaurant_name.title() + ' is a ' + self.cuisine_type +
' restaurant.')
def open_restaurant(self):
... | true | true |
f7fed066f2b8742d63342321e424b30c75c45e03 | 3,841 | py | Python | src/OTLMOW/PostenMapping/Model/Post060352280.py | davidvlaminck/OTLClassPython | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | 2 | 2022-02-01T08:58:11.000Z | 2022-02-08T13:35:17.000Z | src/OTLMOW/PostenMapping/Model/Post060352280.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | src/OTLMOW/PostenMapping/Model/Post060352280.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | # coding=utf-8
from OTLMOW.PostenMapping.StandaardPost import StandaardPost
from OTLMOW.PostenMapping.StandaardPostMapping import StandaardPostMapping
# Generated with PostenCreator. To modify: extend, do not edit
class Post060352280(StandaardPost):
def __init__(self):
super().__init__(
nummer... | 49.24359 | 148 | 0.587607 |
from OTLMOW.PostenMapping.StandaardPost import StandaardPost
from OTLMOW.PostenMapping.StandaardPostMapping import StandaardPostMapping
class Post060352280(StandaardPost):
def __init__(self):
super().__init__(
nummer='0603.52280',
beschrijving='Bestrating van gebakken straatstene... | true | true |
f7fed0ca952176ae8d9122861f76d3cb01ccc893 | 3,520 | py | Python | interactive.py | Zakobian/WD_gas_disk_imaging | b8bda209e541b442f44fdb6109de8f2f72ec38cf | [
"MIT"
] | null | null | null | interactive.py | Zakobian/WD_gas_disk_imaging | b8bda209e541b442f44fdb6109de8f2f72ec38cf | [
"MIT"
] | null | null | null | interactive.py | Zakobian/WD_gas_disk_imaging | b8bda209e541b442f44fdb6109de8f2f72ec38cf | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from plot_one import plot_me_one
import matplotlib.pyplot as plt
import matplotlib as mpl
from scipy.integrate import simps
M_sun=1.989*10**30;
R_sun=696340*10**3;
M=0.62*M_sun
r_star=0.0151*R_sun
G=6.67408*10**(-11);
####
####
#### This code will create the sandbox and allow user to p... | 25.142857 | 128 | 0.601705 | import cv2
import numpy as np
from plot_one import plot_me_one
import matplotlib.pyplot as plt
import matplotlib as mpl
from scipy.integrate import simps
M_sun=1.989*10**30;
R_sun=696340*10**3;
M=0.62*M_sun
r_star=0.0151*R_sun
G=6.67408*10**(-11);
1)
ax_hist = fig_hist.add_subplot(1, 1, 1)
plt.ion()
plt.xlabel("Vel... | true | true |
f7fed22af91d208a084c6f4b88b64460b550416e | 1,744 | py | Python | HeavyIonsAnalysis/Configuration/python/Skims_HI_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | HeavyIonsAnalysis/Configuration/python/Skims_HI_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | HeavyIonsAnalysis/Configuration/python/Skims_HI_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
from Configuration.EventContent.EventContentHeavyIons_cff import FEVTEventContent
skimContent = FEVTEventContent.clone()
skimContent.outputCommands.append("drop *_MEtoEDMConverter_*_*")
skimContent.outputCommands.append("drop *_*_*_SKIM")
#####################
from HeavyIonsA... | 29.066667 | 81 | 0.694381 | import FWCore.ParameterSet.Config as cms
from Configuration.EventContent.EventContentHeavyIons_cff import FEVTEventContent
skimContent = FEVTEventContent.clone()
skimContent.outputCommands.append("drop *_MEtoEDMConverter_*_*")
skimContent.outputCommands.append("drop *_*_*_SKIM")
diJetSkimPath),
content = skimCont... | true | true |
f7fed37f0ac950cb449ff8c1e416ea2aa1b2b483 | 21,267 | py | Python | src/plus_train.py | Lorraine333/joint-order-cbow | ed22c7b037a8d016a8982c8341bc02edc5054fc3 | [
"Apache-2.0"
] | null | null | null | src/plus_train.py | Lorraine333/joint-order-cbow | ed22c7b037a8d016a8982c8341bc02edc5054fc3 | [
"Apache-2.0"
] | null | null | null | src/plus_train.py | Lorraine333/joint-order-cbow | ed22c7b037a8d016a8982c8341bc02edc5054fc3 | [
"Apache-2.0"
] | null | null | null | """Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this f... | 59.405028 | 583 | 0.723421 |
from __future__ import division
from __future__ import print_function
import time
import random
import tensorflow as tf
import plus_input_data as input_data
import numpy as np
from plus_model import tf_model
import plus_eval_model
import map_eval
import plus_eval_model as eval_model
from collections import default... | true | true |
f7fed59fc952b05ba0983864f343b9b6ad086682 | 3,040 | py | Python | mysite/mysite/settings.py | Akinwale7/Complete-Blog-Application-with-Search-Engine-Built-With-Django | c0095c44549b39c1fce292a2bd84fb042c967558 | [
"MIT"
] | 26 | 2019-10-04T20:37:43.000Z | 2021-11-15T19:54:29.000Z | mysite/mysite/settings.py | Akinwale7/Complete-Blog-Application-with-Search-Engine-Built-With-Django | c0095c44549b39c1fce292a2bd84fb042c967558 | [
"MIT"
] | 1 | 2022-01-14T11:29:11.000Z | 2022-01-14T11:29:11.000Z | mysite/mysite/settings.py | Akinwale7/Complete-Blog-Application-with-Search-Engine-Built-With-Django | c0095c44549b39c1fce292a2bd84fb042c967558 | [
"MIT"
] | 29 | 2019-05-19T11:43:02.000Z | 2021-11-16T13:05:30.000Z | """
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 1.8.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths... | 24.516129 | 71 | 0.689474 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = 't$6p8^=z+%8_zm+qb%s8&!!sh@j%)lg4byd@nc8(s5#ozoz&-l'
DEBUG = True
ALLOWED_HOSTS = []
SITE_ID = 1
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttype... | true | true |
f7fed5a8343a644ce42cf08be59a8acb56b644f0 | 29,286 | py | Python | mne/beamformer/tests/test_dics.py | mdovgialo/mne-python | 8ccc3999da6c15efa03840230c13aeb7bab5618d | [
"BSD-3-Clause"
] | 1 | 2021-06-07T09:40:55.000Z | 2021-06-07T09:40:55.000Z | mne/beamformer/tests/test_dics.py | mdovgialo/mne-python | 8ccc3999da6c15efa03840230c13aeb7bab5618d | [
"BSD-3-Clause"
] | 2 | 2020-09-18T00:09:20.000Z | 2020-11-10T17:47:10.000Z | mne/beamformer/tests/test_dics.py | mdovgialo/mne-python | 8ccc3999da6c15efa03840230c13aeb7bab5618d | [
"BSD-3-Clause"
] | 1 | 2021-01-07T23:08:52.000Z | 2021-01-07T23:08:52.000Z | # Authors: Marijn van Vliet <w.m.vanvliet@gmail.com>
# Britta Westner <britta.wstnr@gmail.com>
#
# License: BSD 3 clause
import copy as cp
import os.path as op
import pytest
from numpy.testing import assert_array_equal, assert_allclose
import numpy as np
import mne
from mne.datasets import testing
from mne.... | 43.258493 | 79 | 0.661818 |
import copy as cp
import os.path as op
import pytest
from numpy.testing import assert_array_equal, assert_allclose
import numpy as np
import mne
from mne.datasets import testing
from mne.beamformer import (make_dics, apply_dics, apply_dics_epochs,
apply_dics_csd, read_beamformer, Beam... | true | true |
f7fed5e0b420fc6c1292823998d4805ba4e2c1cd | 398 | py | Python | lm/utils/registry.py | akashmehra/nlp | 0b2a0690a631d2614d3b124e502e5e651816c645 | [
"MIT"
] | null | null | null | lm/utils/registry.py | akashmehra/nlp | 0b2a0690a631d2614d3b124e502e5e651816c645 | [
"MIT"
] | null | null | null | lm/utils/registry.py | akashmehra/nlp | 0b2a0690a631d2614d3b124e502e5e651816c645 | [
"MIT"
] | null | null | null | from typing import Callable, Any
opts = {}
class Registry(object):
def __init__(self, key: str):
self.key = key
def __call__(self, func: Callable[[], Any]) -> Callable[[], Any]:
def wrapper(*args, **kwargs) -> Any:
key = args[0].__class__.__name__
x = func(*args, **... | 26.533333 | 69 | 0.535176 | from typing import Callable, Any
opts = {}
class Registry(object):
def __init__(self, key: str):
self.key = key
def __call__(self, func: Callable[[], Any]) -> Callable[[], Any]:
def wrapper(*args, **kwargs) -> Any:
key = args[0].__class__.__name__
x = func(*args, **... | true | true |
f7fed6d8c611fec64d022efbfcf9bf5d02d6db47 | 6,917 | py | Python | detectron/datasets/dataset_catalog.py | Jiayuan-Gu/Detectron | 0375b05e867eae12be0ca8c420c9efad687689bf | [
"Apache-2.0"
] | 2 | 2018-09-05T13:54:26.000Z | 2019-09-26T13:36:32.000Z | detectron/datasets/dataset_catalog.py | Jiayuan-Gu/Detectron | 0375b05e867eae12be0ca8c420c9efad687689bf | [
"Apache-2.0"
] | null | null | null | detectron/datasets/dataset_catalog.py | Jiayuan-Gu/Detectron | 0375b05e867eae12be0ca8c420c9efad687689bf | [
"Apache-2.0"
] | 3 | 2018-07-26T08:43:06.000Z | 2020-06-06T17:48:17.000Z | # Copyright (c) 2017-present, Facebook, 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... | 30.742222 | 89 | 0.619488 |
'coco_stuff_val': {
_IM_DIR:
_DATA_DIR + '/coco/coco_val2014',
_ANN_FN:
_DATA_DIR + '/coco/annotations/coco_stuff_val.json'
},
'keypoints_coco_2014_train': {
_IM_DIR:
_DATA_DIR + '/coco/coco_train2014',
_ANN_FN:
_DATA... | true | true |
f7fed76c2431a92eb39d4b1b3c549d2debee531f | 799 | py | Python | hearthstone/migrations/0008_auto_20190111_1448.py | Robilol/django-hearthstone | 49f2eab62e4cddca27af3cbdb7b0bcf01d73d719 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | hearthstone/migrations/0008_auto_20190111_1448.py | Robilol/django-hearthstone | 49f2eab62e4cddca27af3cbdb7b0bcf01d73d719 | [
"PSF-2.0",
"BSD-3-Clause"
] | 13 | 2018-11-11T17:05:08.000Z | 2019-01-22T17:25:18.000Z | hearthstone/migrations/0008_auto_20190111_1448.py | Robilol/django-hearthstone | 49f2eab62e4cddca27af3cbdb7b0bcf01d73d719 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.2.dev20190111110410 on 2019-01-11 14:48
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('hearthstone', '0007_exchange'),
]
operations = [
migrations.RenameField(
model_name='exchange',
old_name='ca... | 23.5 | 63 | 0.536921 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('hearthstone', '0007_exchange'),
]
operations = [
migrations.RenameField(
model_name='exchange',
old_name='card1_id',
new_name='card1',
),
migra... | true | true |
f7fed76e38956c868956936e9c92633f79a9f6e3 | 1,478 | py | Python | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/apigateway/models/BindJdsfGroup.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/apigateway/models/BindJdsfGroup.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/apigateway/models/BindJdsfGroup.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... | 36.95 | 131 | 0.710419 |
class BindJdsfGroup(object):
def __init__(self, environment, jdsfId, jdsfName=None, jdsfRegistryName=None, jdsfParam=None, jdsfRegion=None, groupType=None):
self.jdsfName = jdsfName
self.jdsfRegistryName = jdsfRegistryName
self.environment = environment
self.jdsf... | true | true |
f7fed7b3b050c2189dd0024e52e4d3aa35ac6f30 | 630 | py | Python | saleor/account/migrations/0051_alter_customerevent_user.py | fairhopeweb/saleor | 9ac6c22652d46ba65a5b894da5f1ba5bec48c019 | [
"CC-BY-4.0"
] | 15,337 | 2015-01-12T02:11:52.000Z | 2021-10-05T19:19:29.000Z | saleor/account/migrations/0051_alter_customerevent_user.py | fairhopeweb/saleor | 9ac6c22652d46ba65a5b894da5f1ba5bec48c019 | [
"CC-BY-4.0"
] | 7,486 | 2015-02-11T10:52:13.000Z | 2021-10-06T09:37:15.000Z | saleor/account/migrations/0051_alter_customerevent_user.py | aminziadna/saleor | 2e78fb5bcf8b83a6278af02551a104cfa555a1fb | [
"CC-BY-4.0"
] | 5,864 | 2015-01-16T14:52:54.000Z | 2021-10-05T23:01:15.000Z | # Generated by Django 3.2.2 on 2021-07-01 08:45
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("account", "0050_auto_20210506_1058"),
]
operations = [
migrations.AlterFie... | 24.230769 | 60 | 0.587302 |
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("account", "0050_auto_20210506_1058"),
]
operations = [
migrations.AlterField(
model_name="customerevent",
... | true | true |
f7fed994bc43d09b40e7eb4b7623f8e869e6f1e5 | 841 | bzl | Python | src/test/java/com/google/devtools/build/skydoc/testdata/filter_rules_test/input.bzl | xylocarp-whelky/bazel | 4ba404f7ed0473df3f0effa016c107ef677464f6 | [
"Apache-2.0"
] | 5 | 2019-01-10T09:41:11.000Z | 2020-07-15T12:02:22.000Z | src/test/java/com/google/devtools/build/skydoc/testdata/filter_rules_test/input.bzl | installation00/bazel | 6f38f345a1bd278a71170c5d80aba3928afdc6ec | [
"Apache-2.0"
] | 1 | 2019-09-26T16:39:28.000Z | 2019-09-26T16:39:28.000Z | src/test/java/com/google/devtools/build/skydoc/testdata/filter_rules_test/input.bzl | installation00/bazel | 6f38f345a1bd278a71170c5d80aba3928afdc6ec | [
"Apache-2.0"
] | 3 | 2019-05-05T01:52:36.000Z | 2020-11-04T03:16:14.000Z | load(
":testdata/filter_rules_test/dep.bzl",
"my_rule_impl",
dep_rule = "my_rule",
)
def my_rule_impl(ctx):
return struct()
my_rule = rule(
implementation = my_rule_impl,
doc = "This is my rule. It does stuff.",
attrs = {
"first": attr.label(
mandatory = True,
... | 21.025 | 53 | 0.590963 | load(
":testdata/filter_rules_test/dep.bzl",
"my_rule_impl",
dep_rule = "my_rule",
)
def my_rule_impl(ctx):
return struct()
my_rule = rule(
implementation = my_rule_impl,
doc = "This is my rule. It does stuff.",
attrs = {
"first": attr.label(
mandatory = True,
... | true | true |
f7feda1a571ad4902a85db29d67310b1eee98a37 | 6,086 | py | Python | sympy/printing/tests/test_tree.py | ethankward/sympy | 44664d9f625a1c68bc492006cfe1012cb0b49ee4 | [
"BSD-3-Clause"
] | 2 | 2019-05-18T22:36:49.000Z | 2019-05-24T05:56:16.000Z | sympy/printing/tests/test_tree.py | ethankward/sympy | 44664d9f625a1c68bc492006cfe1012cb0b49ee4 | [
"BSD-3-Clause"
] | 2 | 2020-08-18T15:21:59.000Z | 2020-08-18T19:35:29.000Z | sympy/printing/tests/test_tree.py | ethankward/sympy | 44664d9f625a1c68bc492006cfe1012cb0b49ee4 | [
"BSD-3-Clause"
] | 3 | 2021-02-16T16:40:49.000Z | 2022-03-07T18:28:41.000Z | from sympy.printing.tree import tree
from sympy.testing.pytest import XFAIL
# Remove this flag after making _assumptions cache deterministic.
@XFAIL
def test_print_tree_MatAdd():
from sympy.matrices.expressions import MatrixSymbol
A = MatrixSymbol('A', 3, 3)
B = MatrixSymbol('B', 3, 3)
test_str = [
... | 30.893401 | 65 | 0.490799 | from sympy.printing.tree import tree
from sympy.testing.pytest import XFAIL
@XFAIL
def test_print_tree_MatAdd():
from sympy.matrices.expressions import MatrixSymbol
A = MatrixSymbol('A', 3, 3)
B = MatrixSymbol('B', 3, 3)
test_str = [
'MatAdd: A + B\n',
'algebraic: False\n',
'... | true | true |
f7feda89047c4629e8c00b7c3cfff82f31a45883 | 8,828 | py | Python | multiprocessing_parse.py | qftphys/Software-for-visualising-magnetic-layers | 7e4c5680b8e87aa677bdf4c912cbccdcb11b09a3 | [
"MIT"
] | null | null | null | multiprocessing_parse.py | qftphys/Software-for-visualising-magnetic-layers | 7e4c5680b8e87aa677bdf4c912cbccdcb11b09a3 | [
"MIT"
] | null | null | null | multiprocessing_parse.py | qftphys/Software-for-visualising-magnetic-layers | 7e4c5680b8e87aa677bdf4c912cbccdcb11b09a3 | [
"MIT"
] | null | null | null | import numpy as np
import os
import glob
from multiprocessing import Pool
from cython_modules.cython_parse import *
from binaryornot.check import is_binary
import re
def asynchronous_pool_order(func, args, object_list, timeout=20):
pool = Pool()
output_list = []
multiple_results = [pool.apply_async(func, (... | 40.87037 | 100 | 0.559243 | import numpy as np
import os
import glob
from multiprocessing import Pool
from cython_modules.cython_parse import *
from binaryornot.check import is_binary
import re
def asynchronous_pool_order(func, args, object_list, timeout=20):
pool = Pool()
output_list = []
multiple_results = [pool.apply_async(func, (... | true | true |
f7fedb7734ebdc600d584a84f3541e266bfa503c | 7,928 | py | Python | tests/sentry/api/endpoints/test_project_release_files.py | seukjung/sentry-custom | c5f6bb2019aef3caff7f3e2b619f7a70f2b9b963 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/api/endpoints/test_project_release_files.py | seukjung/sentry-custom | c5f6bb2019aef3caff7f3e2b619f7a70f2b9b963 | [
"BSD-3-Clause"
] | 8 | 2019-12-28T23:49:55.000Z | 2022-03-02T04:34:18.000Z | tests/sentry/api/endpoints/test_project_release_files.py | seukjung/sentry-custom | c5f6bb2019aef3caff7f3e2b619f7a70f2b9b963 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import six
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.urlresolvers import reverse
from sentry.models import File, Release, ReleaseFile
from sentry.testutils import APITestCase
class ReleaseFilesListTest(APITestCase):
def test_simple(sel... | 34.320346 | 94 | 0.589934 | from __future__ import absolute_import
import six
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.urlresolvers import reverse
from sentry.models import File, Release, ReleaseFile
from sentry.testutils import APITestCase
class ReleaseFilesListTest(APITestCase):
def test_simple(sel... | true | true |
f7fedc2e0417ea5154371b501db465be1fe72b36 | 355 | py | Python | yt/frontends/tipsy/setup.py | danielgrassinger/yt_new_frontend | 5f91d2fb8721c4c5da0af543a6256ed979cd9fc9 | [
"BSD-3-Clause-Clear"
] | null | null | null | yt/frontends/tipsy/setup.py | danielgrassinger/yt_new_frontend | 5f91d2fb8721c4c5da0af543a6256ed979cd9fc9 | [
"BSD-3-Clause-Clear"
] | 1 | 2016-04-05T22:30:14.000Z | 2016-04-05T22:30:14.000Z | yt/frontends/tipsy/setup.py | danielgrassinger/yt_new_frontend | 5f91d2fb8721c4c5da0af543a6256ed979cd9fc9 | [
"BSD-3-Clause-Clear"
] | 1 | 2020-12-05T05:51:09.000Z | 2020-12-05T05:51:09.000Z | #!/usr/bin/env python
import setuptools
import os
import sys
import os.path
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('tipsy', parent_package, top_path)
config.make_config_py() # installs __config__.py
#config.make_... | 25.357143 | 61 | 0.76338 |
import setuptools
import os
import sys
import os.path
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('tipsy', parent_package, top_path)
config.make_config_py()
return config
| true | true |
f7fee44aa20c72aaa998e09bd0f3f7f79a17d4bc | 2,965 | py | Python | main.py | limdool/03-Text-adventure-1 | 5c8098b7e5dd33412b3aa2b1f9b573028cb60725 | [
"MIT"
] | 1 | 2019-09-18T16:20:33.000Z | 2019-09-18T16:20:33.000Z | main.py | limdool/03-Text-adventure-1 | 5c8098b7e5dd33412b3aa2b1f9b573028cb60725 | [
"MIT"
] | null | null | null | main.py | limdool/03-Text-adventure-1 | 5c8098b7e5dd33412b3aa2b1f9b573028cb60725 | [
"MIT"
] | 1 | 2019-09-28T16:03:18.000Z | 2019-09-28T16:03:18.000Z | import sys, logging, json, os
#check to make sure we are running the right version of Python
version = (3,7)
assert sys.version_info >= version, "This script requires at least Python {0}.{1}".format(version[0],version[1])
#turn on logging, in case we have to leave ourselves debugging messages
logging.basicConfig(form... | 33.693182 | 112 | 0.61855 | import sys, logging, json, os
version = (3,7)
assert sys.version_info >= version, "This script requires at least Python {0}.{1}".format(version[0],version[1])
logging.basicConfig(format='[%(filename)s:%(lineno)d] %(message)s', level=logging.DEBUG)
logger = logging.getLogger(__name__)
def render(game,current):
... | true | true |
f7fee4a50c1d51bdfe2aadc905d93a2a83afc3cb | 1,035 | py | Python | src/sagemaker/tensorflow/__init__.py | mufaddal-rohawala/sagemaker-python-sdk | 72c12bb1481c368f799b17c38d07c5fc34864093 | [
"Apache-2.0"
] | null | null | null | src/sagemaker/tensorflow/__init__.py | mufaddal-rohawala/sagemaker-python-sdk | 72c12bb1481c368f799b17c38d07c5fc34864093 | [
"Apache-2.0"
] | 20 | 2021-09-17T20:50:11.000Z | 2021-12-09T00:29:02.000Z | src/sagemaker/tensorflow/__init__.py | mufaddal-rohawala/sagemaker-python-sdk | 72c12bb1481c368f799b17c38d07c5fc34864093 | [
"Apache-2.0"
] | null | null | null | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompan... | 49.285714 | 94 | 0.789372 |
from __future__ import absolute_import
from sagemaker.tensorflow.estimator import TensorFlow
from sagemaker.tensorflow.model import TensorFlowModel, TensorFlowPredictor
from sagemaker.tensorflow.processing import TensorFlowProcessor
from sagemaker.tensorflow.training_compiler.config import TrainingC... | true | true |
f7fee58d9e4b265f09b550c78c78d8b82b7d691b | 9,947 | py | Python | dhnx/plotting.py | rbv83/DHNx | e236d720c7ec3c0f400648b96141454557d35476 | [
"MIT"
] | 14 | 2020-06-25T14:03:21.000Z | 2021-11-25T12:53:08.000Z | dhnx/plotting.py | rbv83/DHNx | e236d720c7ec3c0f400648b96141454557d35476 | [
"MIT"
] | 51 | 2020-02-19T14:42:38.000Z | 2022-03-23T08:30:31.000Z | dhnx/plotting.py | oemof-heat/district_heating_simulation | edb5c9be17f74d7f200c1eb6a17000a26633bdc3 | [
"MIT"
] | 3 | 2020-10-23T15:54:11.000Z | 2022-02-28T12:53:09.000Z | # -*- coding: utf-8
"""
This module is designed to hold functions for visualization.
This file is part of project dhnx (). It's copyrighted
by the contributors recorded in the version control history of the file,
available from its original location:
SPDX-License-Identifier: MIT
"""
import logging
from collections ... | 34.658537 | 86 | 0.542877 |
import logging
from collections import namedtuple
import folium as fol
import matplotlib.collections as collections
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from folium.features import DivIcon
logger = logging.getLogger()
logger.setLevel(logging.INFO)
cartopy_installed = True
try:
... | true | true |
f7fee5bdabe6f581fa5d488875d2a2c44514f0e6 | 4,353 | py | Python | httpie/config.py | HenryGessau/httpie | 85ba9ad8eaa718d7f9dbcb7129168d6a877f3d30 | [
"BSD-3-Clause"
] | 2 | 2022-01-31T18:18:58.000Z | 2022-01-31T18:26:35.000Z | httpie/config.py | isidentical/httpie | 85ba9ad8eaa718d7f9dbcb7129168d6a877f3d30 | [
"BSD-3-Clause"
] | 2 | 2022-03-05T19:16:08.000Z | 2022-03-05T19:16:09.000Z | httpie/config.py | isidentical/httpie | 85ba9ad8eaa718d7f9dbcb7129168d6a877f3d30 | [
"BSD-3-Clause"
] | null | null | null | import json
import os
from pathlib import Path
from typing import Any, Dict, Union
from . import __version__
from .compat import is_windows
from .encoding import UTF8
ENV_XDG_CONFIG_HOME = 'XDG_CONFIG_HOME'
ENV_HTTPIE_CONFIG_DIR = 'HTTPIE_CONFIG_DIR'
DEFAULT_CONFIG_DIRNAME = 'httpie'
DEFAULT_RELATIVE_XDG_CONFIG_HOME... | 28.083871 | 82 | 0.644153 | import json
import os
from pathlib import Path
from typing import Any, Dict, Union
from . import __version__
from .compat import is_windows
from .encoding import UTF8
ENV_XDG_CONFIG_HOME = 'XDG_CONFIG_HOME'
ENV_HTTPIE_CONFIG_DIR = 'HTTPIE_CONFIG_DIR'
DEFAULT_CONFIG_DIRNAME = 'httpie'
DEFAULT_RELATIVE_XDG_CONFIG_HOME... | true | true |
f7fee6a666686928ba0dfb3d210196a36c39857e | 816 | py | Python | service/kafka.py | tbicr/sites-availability-checker | d1c72c5b9ef226d76d5925c6a880919dcb137094 | [
"MIT"
] | null | null | null | service/kafka.py | tbicr/sites-availability-checker | d1c72c5b9ef226d76d5925c6a880919dcb137094 | [
"MIT"
] | null | null | null | service/kafka.py | tbicr/sites-availability-checker | d1c72c5b9ef226d76d5925c6a880919dcb137094 | [
"MIT"
] | null | null | null | import aiokafka
from aiokafka.helpers import create_ssl_context
from service import config
from service.entities import Event
async def kafka_producer_factory(config):
if config["ssl_context"]:
config = dict(config, ssl_context=create_ssl_context(**config["ssl_context"]))
producer = aiokafka.AIOKafka... | 31.384615 | 86 | 0.761029 | import aiokafka
from aiokafka.helpers import create_ssl_context
from service import config
from service.entities import Event
async def kafka_producer_factory(config):
if config["ssl_context"]:
config = dict(config, ssl_context=create_ssl_context(**config["ssl_context"]))
producer = aiokafka.AIOKafka... | true | true |
f7fee83ddebacf020bc16659880094a458ff4356 | 10,124 | py | Python | scripts/build_signal_pages.py | malariagen/agam-selection-atlas | 6150b47b4ec15558193912ef2612aaae48567c58 | [
"MIT"
] | 3 | 2018-03-02T14:53:48.000Z | 2019-12-25T23:46:59.000Z | scripts/build_signal_pages.py | malariagen/agam-selection-atlas | 6150b47b4ec15558193912ef2612aaae48567c58 | [
"MIT"
] | 23 | 2017-12-19T23:47:53.000Z | 2020-09-01T20:48:56.000Z | scripts/build_signal_pages.py | malariagen/agam-selection-atlas | 6150b47b4ec15558193912ef2612aaae48567c58 | [
"MIT"
] | 1 | 2019-08-22T21:40:19.000Z | 2019-08-22T21:40:19.000Z | # -*- coding: utf-8 -*-
from setup import *
def plot_signal_location(report, plot_width=900, plot_height=200):
fig = bplt.figure(title='Signal location', plot_width=plot_width,
plot_height=plot_height,
tools='xpan,xzoom_in,xzoom_out,xwheel_zoom,reset',
... | 38.641221 | 92 | 0.584552 |
from setup import *
def plot_signal_location(report, plot_width=900, plot_height=200):
fig = bplt.figure(title='Signal location', plot_width=plot_width,
plot_height=plot_height,
tools='xpan,xzoom_in,xzoom_out,xwheel_zoom,reset',
toolbar_location='... | true | true |
f7fee843617de4c7be474b3092ae4adad1257c81 | 208 | py | Python | test.py | j0nm1/pipeline-python-demo-issue | 3706c043950d2e9570140f83cc4b05e9c9b6a29f | [
"MIT"
] | null | null | null | test.py | j0nm1/pipeline-python-demo-issue | 3706c043950d2e9570140f83cc4b05e9c9b6a29f | [
"MIT"
] | 6 | 2020-05-30T13:55:57.000Z | 2021-10-20T06:11:52.000Z | test.py | j0nm1/pipeline-python-demo-issue | 3706c043950d2e9570140f83cc4b05e9c9b6a29f | [
"MIT"
] | 1 | 2020-06-26T10:49:51.000Z | 2020-06-26T10:49:51.000Z | from unittest import TestCase
from pet import Pet
class PetTestCase(TestCase):
def setUp(self):
self.pet = Pet("Test")
def test_name(self):
self.assertEqual(self.pet.name, "Test")
| 17.333333 | 47 | 0.663462 | from unittest import TestCase
from pet import Pet
class PetTestCase(TestCase):
def setUp(self):
self.pet = Pet("Test")
def test_name(self):
self.assertEqual(self.pet.name, "Test")
| true | true |
f7fee8725e952074176c0e9062ca9ee462550c9e | 586 | py | Python | simulation_ws/build/deepracer_msgs/catkin_generated/pkg.develspace.context.pc.py | we437b/dr_logger | fa47ca74dc46b8ddd596b7255b23f24034db45ac | [
"MIT"
] | null | null | null | simulation_ws/build/deepracer_msgs/catkin_generated/pkg.develspace.context.pc.py | we437b/dr_logger | fa47ca74dc46b8ddd596b7255b23f24034db45ac | [
"MIT"
] | null | null | null | simulation_ws/build/deepracer_msgs/catkin_generated/pkg.develspace.context.pc.py | we437b/dr_logger | fa47ca74dc46b8ddd596b7255b23f24034db45ac | [
"MIT"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/inspacehj/dr_logger/simulation_ws/build/deepracer_msgs/devel/include".split(';') if "/home/inspacehj/dr_logger/simulation_ws/build/deepracer_msgs/devel/include" != "" else []
PROJECT_CATKIN_DEPEN... | 65.111111 | 215 | 0.778157 |
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/inspacehj/dr_logger/simulation_ws/build/deepracer_msgs/devel/include".split(';') if "/home/inspacehj/dr_logger/simulation_ws/build/deepracer_msgs/devel/include" != "" else []
PROJECT_CATKIN_DEPENDS = "message_runtime;std_msgs".replace(';', ' ')
PKG_CO... | true | true |
f7fee96a3b931fbe9af77c83bdfe78a8174a72c9 | 6,582 | py | Python | tests/h/services/user_test.py | pombredanne/h | 9c4c2dc0d53ed5bed5183936c24b4c27b23070b4 | [
"BSD-2-Clause"
] | 2,103 | 2015-01-07T12:47:49.000Z | 2022-03-29T02:38:25.000Z | tests/h/services/user_test.py | pombredanne/h | 9c4c2dc0d53ed5bed5183936c24b4c27b23070b4 | [
"BSD-2-Clause"
] | 4,322 | 2015-01-04T17:18:01.000Z | 2022-03-31T17:06:02.000Z | tests/h/services/user_test.py | pombredanne/h | 9c4c2dc0d53ed5bed5183936c24b4c27b23070b4 | [
"BSD-2-Clause"
] | 389 | 2015-01-24T04:10:02.000Z | 2022-03-28T08:00:16.000Z | import pytest
from h.models import User
from h.services.user import UserNotActivated, UserService, user_service_factory
@pytest.mark.usefixtures("users")
class TestUserService:
def test_fetch_retrieves_user_by_userid(self, svc):
result = svc.fetch("acct:jacqui@foo.com")
assert isinstance(result,... | 34.642105 | 85 | 0.665299 | import pytest
from h.models import User
from h.services.user import UserNotActivated, UserService, user_service_factory
@pytest.mark.usefixtures("users")
class TestUserService:
def test_fetch_retrieves_user_by_userid(self, svc):
result = svc.fetch("acct:jacqui@foo.com")
assert isinstance(result,... | true | true |
f7fee991e3b32f7c2dcb42a61ae593b8d2d82fe8 | 2,384 | py | Python | boundary/sampling/normal.py | shiyuchengTJU/CISA | 81c43d2ee2ba1224e307baf636f1c87bfddd2ffa | [
"MIT"
] | null | null | null | boundary/sampling/normal.py | shiyuchengTJU/CISA | 81c43d2ee2ba1224e307baf636f1c87bfddd2ffa | [
"MIT"
] | null | null | null | boundary/sampling/normal.py | shiyuchengTJU/CISA | 81c43d2ee2ba1224e307baf636f1c87bfddd2ffa | [
"MIT"
] | null | null | null | """
Noise generation from Normal distributions.
"""
import numpy as np
def sample_hypersphere(n_samples, sample_shape, radius, l_norm=2, mode='sphere', sample_gen=None, seed=None):
"""
Uniformly sample the surface of a hypersphere.
Uniform picking: create a n-dimensional normal distribution and... | 44.981132 | 126 | 0.676174 |
import numpy as np
def sample_hypersphere(n_samples, sample_shape, radius, l_norm=2, mode='sphere', sample_gen=None, seed=None):
if sample_gen is not None:
assert seed is None, "Can't provide individual seeds if using the multi-threaded generator."
assert sample_shape == sample_gen.shape... | true | true |
f7feeb89e2e53161f7912de60416b46973da8272 | 3,406 | py | Python | src/gtk3/headerbar/MainWindow.py | alexandrebarbaruiva/gui-python-gtk | 7b8e8ab05645271ae55e1e2165eefc9c8f5b0250 | [
"MIT"
] | 42 | 2020-05-09T16:23:23.000Z | 2022-03-28T13:05:32.000Z | src/gtk3/headerbar/MainWindow.py | alexandrebarbaruiva/gui-python-gtk | 7b8e8ab05645271ae55e1e2165eefc9c8f5b0250 | [
"MIT"
] | 2 | 2020-05-27T19:23:54.000Z | 2022-03-08T01:42:59.000Z | src/gtk3/headerbar/MainWindow.py | alexandrebarbaruiva/gui-python-gtk | 7b8e8ab05645271ae55e1e2165eefc9c8f5b0250 | [
"MIT"
] | 8 | 2020-05-09T16:23:28.000Z | 2022-03-31T22:44:45.000Z | # -*- coding: utf-8 -*-
"""Gtk.HeaderBar()."""
import gi
gi.require_version(namespace='Gtk', version='3.0')
from gi.repository import Gio, Gtk
class MainWindow(Gtk.ApplicationWindow):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.set_title(title='Gtk.HeaderBar')
self.se... | 32.438095 | 79 | 0.660599 |
import gi
gi.require_version(namespace='Gtk', version='3.0')
from gi.repository import Gio, Gtk
class MainWindow(Gtk.ApplicationWindow):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.set_title(title='Gtk.HeaderBar')
self.set_default_size(width=1366 / 2, height=768 / 2)... | true | true |
f7feec529c6ae142cb1e6f18d183549241187c20 | 10,691 | py | Python | tests/optim/test_oss.py | joshim5/fairscale | 1c2a6f6b46646866f3e86d628b8a4ca437f68215 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/optim/test_oss.py | joshim5/fairscale | 1c2a6f6b46646866f3e86d628b8a4ca437f68215 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/optim/test_oss.py | joshim5/fairscale | 1c2a6f6b46646866f3e86d628b8a4ca437f68215 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
#
# This source code is licensed under the BSD license found in the
# LICENSE file in the root directory of this source tree.
# pylint: disable=missing-module-docstring
# pylint: disable=missing-class-docstring
# pylint: disable=missing-function-d... | 31.724036 | 108 | 0.659994 |
import os
import pytest
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
import fairscale.optim as optim
skip_if_no_cuda = pytest.mark.skipif(not torch.cuda.is_available(), reason="cuda required")
BACKEND = dist.Backend.NCCL if torch.cuda.is_available() else dist.Backend.GLO... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.