hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c1e9523506764ea883014e8ee705ff1565e6c9d | 7,159 | py | Python | onem2m/resources.py | franjial/ghostm2m | 2e7898761237cb12f4fddd55665b3a15fb84dddc | [
"MIT"
] | null | null | null | onem2m/resources.py | franjial/ghostm2m | 2e7898761237cb12f4fddd55665b3a15fb84dddc | [
"MIT"
] | null | null | null | onem2m/resources.py | franjial/ghostm2m | 2e7898761237cb12f4fddd55665b3a15fb84dddc | [
"MIT"
] | null | null | null | from onem2m.types import Operation, ResourceType, cseTypeID
from pymongo import MongoClient
from bson.objectid import ObjectId
from abc import ABC, abstractmethod
import json
import datetime
class AbstractFactory(ABC):
"""
"""
@abstractmethod
def create_container(self):
pass
@abstractmethod
def create_conten... | 21.960123 | 91 | 0.647297 | from onem2m.types import Operation, ResourceType, cseTypeID
from pymongo import MongoClient
from bson.objectid import ObjectId
from abc import ABC, abstractmethod
import json
import datetime
class AbstractFactory(ABC):
@abstractmethod
def create_container(self):
pass
@abstractmethod
def create_content_instance(... | true | true |
1c1e95b499907398f7ab58485d52a1709507c3f3 | 13,401 | py | Python | edo_client/rtc.py | easydo-cn/edo_client | 775f185c54f2eeda6a7dd6482de8228ca9ad89b0 | [
"Apache-2.0"
] | null | null | null | edo_client/rtc.py | easydo-cn/edo_client | 775f185c54f2eeda6a7dd6482de8228ca9ad89b0 | [
"Apache-2.0"
] | null | null | null | edo_client/rtc.py | easydo-cn/edo_client | 775f185c54f2eeda6a7dd6482de8228ca9ad89b0 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import sys
import time
import json
import logging
import traceback
import certifi
import paho.mqtt.client as mqtt
from datetime import datetime
from .client import MessageClient, WoClient
MSG_QOS = 1
MSG_KEEPALIVE = 60
COMMAND_CATEGORY = 'command'
MSG_HANDLERS = {}
def get_logger(level=logging.DEBU... | 33.586466 | 93 | 0.551228 |
import sys
import time
import json
import logging
import traceback
import certifi
import paho.mqtt.client as mqtt
from datetime import datetime
from .client import MessageClient, WoClient
MSG_QOS = 1
MSG_KEEPALIVE = 60
COMMAND_CATEGORY = 'command'
MSG_HANDLERS = {}
def get_logger(level=logging.DEBUG, logconsole=F... | true | true |
1c1e967780349586d21eedc1bee18ac8721efbbe | 101 | py | Python | py_tdlib/constructors/text_entity_type_mention_name.py | Mr-TelegramBot/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 24 | 2018-10-05T13:04:30.000Z | 2020-05-12T08:45:34.000Z | py_tdlib/constructors/text_entity_type_mention_name.py | MrMahdi313/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 3 | 2019-06-26T07:20:20.000Z | 2021-05-24T13:06:56.000Z | py_tdlib/constructors/text_entity_type_mention_name.py | MrMahdi313/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 5 | 2018-10-05T14:29:28.000Z | 2020-08-11T15:04:10.000Z | from ..factory import Type
class textEntityTypeMentionName(Type):
user_id = None # type: "int32"
| 16.833333 | 38 | 0.742574 | from ..factory import Type
class textEntityTypeMentionName(Type):
user_id = None
| true | true |
1c1e975cdd107679a64af988afb13ca0b3d51bb3 | 3,953 | py | Python | amg/tests/test_fgdcmetadata.py | europlanet-gmap/automated-metadata-generation | aa91790e74d33cc3ae0d68dcf0bf860442ba21c7 | [
"CC0-1.0"
] | 3 | 2021-05-28T22:15:47.000Z | 2021-06-09T17:51:47.000Z | amg/tests/test_fgdcmetadata.py | europlanet-gmap/automated-metadata-generation | aa91790e74d33cc3ae0d68dcf0bf860442ba21c7 | [
"CC0-1.0"
] | 11 | 2021-04-08T20:02:16.000Z | 2021-12-07T13:18:48.000Z | amg/tests/test_fgdcmetadata.py | europlanet-gmap/automated-metadata-generation | aa91790e74d33cc3ae0d68dcf0bf860442ba21c7 | [
"CC0-1.0"
] | 5 | 2021-09-21T18:59:51.000Z | 2022-02-26T09:42:19.000Z | import os
import xml.etree.ElementTree as ET
import pytest
from amg import fgdcmetadata as fgdc
@pytest.fixture
def fgdc_metadata_equi(datadir):
return fgdc.FGDCMetadata(os.path.join(datadir, 'fgdc_template.xml'), proj='equirect')
@pytest.fixture
def fgdc_metadata_ortho(datadir):
return fgdc.FGDCMetadata(os... | 36.266055 | 98 | 0.660005 | import os
import xml.etree.ElementTree as ET
import pytest
from amg import fgdcmetadata as fgdc
@pytest.fixture
def fgdc_metadata_equi(datadir):
return fgdc.FGDCMetadata(os.path.join(datadir, 'fgdc_template.xml'), proj='equirect')
@pytest.fixture
def fgdc_metadata_ortho(datadir):
return fgdc.FGDCMetadata(os... | true | true |
1c1e97b7237af2efe9f42dc09f5d0aeadf075b24 | 972 | py | Python | release/build_release.py | pineapplemachine/mwde | e68378b74d1712347351f1d8fe41edd434d7af16 | [
"MIT"
] | 6 | 2018-08-19T18:50:13.000Z | 2021-06-05T01:14:24.000Z | release/build_release.py | pineapplemachine/mwde | e68378b74d1712347351f1d8fe41edd434d7af16 | [
"MIT"
] | 1 | 2018-12-01T14:18:34.000Z | 2018-12-01T14:59:22.000Z | release/build_release.py | pineapplemachine/mwde | e68378b74d1712347351f1d8fe41edd434d7af16 | [
"MIT"
] | 1 | 2021-06-05T01:14:31.000Z | 2021-06-05T01:14:31.000Z | import os
import shutil
import zipfile
version = "v1.2"
output_dir = "Morrowind Dialog Explorer %s" % version
print("Starting...")
os.mkdir(output_dir)
shutil.copytree("../src", os.path.join(output_dir, "src"), ignore=shutil.ignore_patterns("*.pyc", "__pycache__"))
shutil.copytree("../Morrowind Dialog Explorer.app... | 34.714286 | 113 | 0.716049 | import os
import shutil
import zipfile
version = "v1.2"
output_dir = "Morrowind Dialog Explorer %s" % version
print("Starting...")
os.mkdir(output_dir)
shutil.copytree("../src", os.path.join(output_dir, "src"), ignore=shutil.ignore_patterns("*.pyc", "__pycache__"))
shutil.copytree("../Morrowind Dialog Explorer.app... | true | true |
1c1e98655868e2c8a3a9e18b36b400e6bf8e5b39 | 190 | py | Python | sundial/__init__.py | jcass77/django-sundial | a9479a866fa676329691ab78464a7413f723f54b | [
"MIT"
] | null | null | null | sundial/__init__.py | jcass77/django-sundial | a9479a866fa676329691ab78464a7413f723f54b | [
"MIT"
] | null | null | null | sundial/__init__.py | jcass77/django-sundial | a9479a866fa676329691ab78464a7413f723f54b | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.utils import version
__all__ = ['VERSION', '__version__']
VERSION = (1, 0, 5, 'alpha', 0)
__version__ = version.get_version(VERSION)
| 17.272727 | 42 | 0.742105 | from __future__ import unicode_literals
from django.utils import version
__all__ = ['VERSION', '__version__']
VERSION = (1, 0, 5, 'alpha', 0)
__version__ = version.get_version(VERSION)
| true | true |
1c1e987b00780bc4b5a8f0502b058a1484b3d1d0 | 1,895 | py | Python | Curso_Intensivo_de_Python/capitulo_03-listas/c03_ex05-alterando_lista.py | henriqaqui/Livros | 56668855fda20c29484212cdb77eb6c433815eed | [
"MIT"
] | 1 | 2021-11-25T00:50:39.000Z | 2021-11-25T00:50:39.000Z | Curso_Intensivo_de_Python/capitulo_03-listas/c03_ex05-alterando_lista.py | henriqaqui/Livros | 56668855fda20c29484212cdb77eb6c433815eed | [
"MIT"
] | null | null | null | Curso_Intensivo_de_Python/capitulo_03-listas/c03_ex05-alterando_lista.py | henriqaqui/Livros | 56668855fda20c29484212cdb77eb6c433815eed | [
"MIT"
] | null | null | null | """
=======================================================================================================================
Filename: c03_ex05-alterando_lista.py
Author: Henrique Rodrigues
Description: CURSO INTENSIVO DE PYTHON - Eric Matthes
3.5 Alterando a lista de convidados: Você ac... | 45.119048 | 120 | 0.586807 |
listaConvidados = ['Alexandre', 'Gustavo', 'Ana', 'Sebastiana', 'Rômulo']
listaReserva = ['Marcos', 'André']
naoComparecer = "Gustavo"
novoConvidado = ""
quantidadeConvidados = len(listaConvidados)
i = 0
while i < quantidadeConvidados :
print(f"Oi, {listaConvidados[i]}! ABRA O CONVITE")
i += 1
listaConvidad... | true | true |
1c1e9911b7a628efcdeeadf88988e5ad9771094a | 560 | py | Python | tests/test_graph.py | hasnainroopawalla/Ant-Colony-Optimization | 73b65a6fd14e3e5517b479cfecac1140f0ae7899 | [
"MIT"
] | null | null | null | tests/test_graph.py | hasnainroopawalla/Ant-Colony-Optimization | 73b65a6fd14e3e5517b479cfecac1140f0ae7899 | [
"MIT"
] | null | null | null | tests/test_graph.py | hasnainroopawalla/Ant-Colony-Optimization | 73b65a6fd14e3e5517b479cfecac1140f0ae7899 | [
"MIT"
] | null | null | null | from aco_routing.utils.graph import Graph
G = Graph()
G.add_node("A")
G.add_node("B")
G.add_node("C")
G.add_edge("A", "B", 5)
G.add_edge("A", "C", 8)
G.add_edge("B", "C", 56)
G.add_edge("C", "A", 33)
def test_get_nodes() -> None:
assert G.get_all_nodes() == ["A", "B", "C"]
def test_get_neighbors() -> None:
... | 18.666667 | 62 | 0.608929 | from aco_routing.utils.graph import Graph
G = Graph()
G.add_node("A")
G.add_node("B")
G.add_node("C")
G.add_edge("A", "B", 5)
G.add_edge("A", "C", 8)
G.add_edge("B", "C", 56)
G.add_edge("C", "A", 33)
def test_get_nodes() -> None:
assert G.get_all_nodes() == ["A", "B", "C"]
def test_get_neighbors() -> None:
... | true | true |
1c1e9956d94816a142f7407750f35237db2d4e26 | 14,433 | py | Python | multitrainer.py | dwhalen/holophrasm | 0d971428f9879ad3d6c0a781f1a021cff73fb1ce | [
"MIT"
] | 33 | 2016-09-23T15:05:24.000Z | 2021-08-30T11:13:35.000Z | multitrainer.py | dwhalen/holophrasm | 0d971428f9879ad3d6c0a781f1a021cff73fb1ce | [
"MIT"
] | 4 | 2016-12-14T03:41:55.000Z | 2020-05-27T20:27:55.000Z | multitrainer.py | dwhalen/holophrasm | 0d971428f9879ad3d6c0a781f1a021cff73fb1ce | [
"MIT"
] | 12 | 2016-08-20T10:40:21.000Z | 2022-01-03T09:47:01.000Z | import learning_history
import data_utils5 as data_utils
import random
import numpy as np
import time
import os
import sys
import pickle as pickle
import matplotlib.pyplot as plt
#from pathos.multiprocessing import ProcessingPool as Pool
from multiprocessing import Pool
from multiprocessing import Process, Queue
i... | 36.355164 | 130 | 0.60625 | import learning_history
import data_utils5 as data_utils
import random
import numpy as np
import time
import os
import sys
import pickle as pickle
import matplotlib.pyplot as plt
from multiprocessing import Pool
from multiprocessing import Process, Queue
import signal
global_trainer = None
class Trainer(object)... | true | true |
1c1e99c2469d1255464b89fece28c7c0d3c7b2df | 1,029 | py | Python | pl_gaze_estimation/models/utils/utils.py | hysts/pl_gaze_estimation | 1123053a57115da5bb8ea9675911e7d9230f3ec9 | [
"MIT"
] | 10 | 2021-11-27T20:12:14.000Z | 2022-03-21T09:02:33.000Z | pl_gaze_estimation/models/utils/utils.py | hysts/pl_gaze_estimation | 1123053a57115da5bb8ea9675911e7d9230f3ec9 | [
"MIT"
] | 1 | 2022-02-24T08:03:11.000Z | 2022-02-26T06:13:15.000Z | pl_gaze_estimation/models/utils/utils.py | hysts/pl_gaze_estimation | 1123053a57115da5bb8ea9675911e7d9230f3ec9 | [
"MIT"
] | 3 | 2021-11-29T02:22:41.000Z | 2022-01-18T08:11:49.000Z | import torch
from omegaconf import DictConfig
from .initializer import create_initializer
def initialize_weight(init_config: DictConfig, model: torch.nn.Module) -> None:
initializer = create_initializer(init_config)
model.apply(initializer)
def load_weight(model_config: DictConfig, model: torch.nn.Module) ... | 35.482759 | 79 | 0.702624 | import torch
from omegaconf import DictConfig
from .initializer import create_initializer
def initialize_weight(init_config: DictConfig, model: torch.nn.Module) -> None:
initializer = create_initializer(init_config)
model.apply(initializer)
def load_weight(model_config: DictConfig, model: torch.nn.Module) ... | true | true |
1c1e9a1aa2b3f99531693d61b21417e6ad27417f | 2,473 | py | Python | tests/test_escape.py | cecton/aiosparql | 169a3d256afbaf1a41915ea2202b746f26be240c | [
"Apache-2.0"
] | null | null | null | tests/test_escape.py | cecton/aiosparql | 169a3d256afbaf1a41915ea2202b746f26be240c | [
"Apache-2.0"
] | null | null | null | tests/test_escape.py | cecton/aiosparql | 169a3d256afbaf1a41915ea2202b746f26be240c | [
"Apache-2.0"
] | null | null | null | import datetime
from decimal import Decimal
import unittest
from aiosparql.escape import (
escape_any, escape_boolean, escape_date, escape_datetime, escape_float,
escape_time, escape_string)
from aiosparql.syntax import Node, RDFTerm
class Escape(unittest.TestCase):
def test_escape_any(self):
now... | 39.253968 | 75 | 0.614638 | import datetime
from decimal import Decimal
import unittest
from aiosparql.escape import (
escape_any, escape_boolean, escape_date, escape_datetime, escape_float,
escape_time, escape_string)
from aiosparql.syntax import Node, RDFTerm
class Escape(unittest.TestCase):
def test_escape_any(self):
now... | true | true |
1c1e9a790563cc0beb97bec66f559bd1183b0f7f | 5,537 | py | Python | tests/e2e/system_test/mon/test_restore_ceph_mon_quorum.py | srivickynesh/ocs-ci | 994b8635a2f44ec7982585cfb293215aa8b27d2a | [
"MIT"
] | null | null | null | tests/e2e/system_test/mon/test_restore_ceph_mon_quorum.py | srivickynesh/ocs-ci | 994b8635a2f44ec7982585cfb293215aa8b27d2a | [
"MIT"
] | null | null | null | tests/e2e/system_test/mon/test_restore_ceph_mon_quorum.py | srivickynesh/ocs-ci | 994b8635a2f44ec7982585cfb293215aa8b27d2a | [
"MIT"
] | null | null | null | import logging
import pytest
from ocs_ci.framework.pytest_customization.marks import (
system_test,
polarion_id,
skipif_ocs_version,
ignore_leftovers,
skipif_external_mode,
)
from ocs_ci.framework.testlib import E2ETest
from ocs_ci.ocs import constants
from ocs_ci.ocs.exceptions import TimeoutExpi... | 32.958333 | 110 | 0.642044 | import logging
import pytest
from ocs_ci.framework.pytest_customization.marks import (
system_test,
polarion_id,
skipif_ocs_version,
ignore_leftovers,
skipif_external_mode,
)
from ocs_ci.framework.testlib import E2ETest
from ocs_ci.ocs import constants
from ocs_ci.ocs.exceptions import TimeoutExpi... | true | true |
1c1e9ac8f66504cd704975540e00bd630e718d09 | 2,535 | py | Python | iocage_lib/ioc_exceptions.py | jamesog/iocage | a22bb44ace4e5a00feae8609cb8462682a3ff4ee | [
"BSD-2-Clause"
] | null | null | null | iocage_lib/ioc_exceptions.py | jamesog/iocage | a22bb44ace4e5a00feae8609cb8462682a3ff4ee | [
"BSD-2-Clause"
] | null | null | null | iocage_lib/ioc_exceptions.py | jamesog/iocage | a22bb44ace4e5a00feae8609cb8462682a3ff4ee | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2014-2018, iocage
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted providing that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | 30.178571 | 79 | 0.728994 |
import collections
from contextlib import contextmanager
class ExceptionWithMsg(Exception):
def __init__(self, message):
if not isinstance(message, str) and not isinstance(
message,
collections.Iterable
):
message = [message]
self... | true | true |
1c1e9b772b923d5cbb4eb9a448cd5f82a8f50739 | 294 | py | Python | movie_inc/seat.py | DimasikZlt/MovieInc | 188ebc5634cc3879b00beadbbe3cae1e91db0b8d | [
"Apache-2.0"
] | null | null | null | movie_inc/seat.py | DimasikZlt/MovieInc | 188ebc5634cc3879b00beadbbe3cae1e91db0b8d | [
"Apache-2.0"
] | null | null | null | movie_inc/seat.py | DimasikZlt/MovieInc | 188ebc5634cc3879b00beadbbe3cae1e91db0b8d | [
"Apache-2.0"
] | null | null | null | class Seat:
def __init__(self, index, is_busy=False):
self.index: int = index
self.is_busy: bool = is_busy
def is_seat_busy(self):
return self.is_busy
def take_seat(self):
self.is_busy = True
def leave_seat(self):
self.is_busy = False
| 21 | 45 | 0.612245 | class Seat:
def __init__(self, index, is_busy=False):
self.index: int = index
self.is_busy: bool = is_busy
def is_seat_busy(self):
return self.is_busy
def take_seat(self):
self.is_busy = True
def leave_seat(self):
self.is_busy = False
| true | true |
1c1e9b87344a976e76976a2eabf835a97b40eac0 | 814 | py | Python | reservations/forms.py | jaanae/tilavarauspalvelu-core | f1ac7c9b96d321b07a214429bce6b80cd262859c | [
"MIT"
] | null | null | null | reservations/forms.py | jaanae/tilavarauspalvelu-core | f1ac7c9b96d321b07a214429bce6b80cd262859c | [
"MIT"
] | 90 | 2020-11-13T07:42:32.000Z | 2022-03-29T08:54:20.000Z | reservations/forms.py | jaanae/tilavarauspalvelu-core | f1ac7c9b96d321b07a214429bce6b80cd262859c | [
"MIT"
] | 8 | 2021-02-10T11:31:22.000Z | 2022-01-28T14:33:47.000Z | from django.forms import CharField, ModelForm, ValidationError
from reservations.models import Reservation
class ReservationForm(ModelForm):
priority = CharField(required=True)
class Meta:
model = Reservation
fields = (
"state",
"priority",
"user",
... | 28.068966 | 81 | 0.599509 | from django.forms import CharField, ModelForm, ValidationError
from reservations.models import Reservation
class ReservationForm(ModelForm):
priority = CharField(required=True)
class Meta:
model = Reservation
fields = (
"state",
"priority",
"user",
... | true | true |
1c1e9c5c837c64c9951570ac670a2e90ddcd5ed4 | 2,787 | py | Python | scripts/misc/double_slash_report.py | caitlinadams/deafrica-scripts | a4c0ac7ba640fd60606da1d214c972cb5b588556 | [
"Apache-2.0"
] | 3 | 2021-11-12T08:07:31.000Z | 2022-02-13T22:18:16.000Z | scripts/misc/double_slash_report.py | caitlinadams/deafrica-scripts | a4c0ac7ba640fd60606da1d214c972cb5b588556 | [
"Apache-2.0"
] | 6 | 2021-09-06T06:01:17.000Z | 2021-09-29T05:24:27.000Z | scripts/misc/double_slash_report.py | digitalearthafrica/scripts | ed1e91857764e77ab0f4fc5ea4e541f1cb8406ad | [
"Apache-2.0"
] | 1 | 2021-11-16T23:38:10.000Z | 2021-11-16T23:38:10.000Z | import os
from concurrent.futures import ThreadPoolExecutor, as_completed
import boto3
from odc.aws import inventory, s3_head_object
os.environ["AWS_ACCESS_KEY_ID"] = ""
os.environ["AWS_SECRET_ACCESS_KEY"] = ""
os.environ["AWS_S3_ENDPOINT"] = "s3.af-south-1.amazonaws.com"
os.environ["AWS_DEFAULT_REGION"] = "af-south-... | 26.292453 | 94 | 0.61141 | import os
from concurrent.futures import ThreadPoolExecutor, as_completed
import boto3
from odc.aws import inventory, s3_head_object
os.environ["AWS_ACCESS_KEY_ID"] = ""
os.environ["AWS_SECRET_ACCESS_KEY"] = ""
os.environ["AWS_S3_ENDPOINT"] = "s3.af-south-1.amazonaws.com"
os.environ["AWS_DEFAULT_REGION"] = "af-south-... | true | true |
1c1e9c7c7ed573a007e21602b34df5657f59441e | 9,945 | py | Python | flask_restx/marshalling.py | TVLIgnacy/flask-restx | 3614028ad498259faf257c1c869c5634e85ed042 | [
"BSD-3-Clause"
] | 1 | 2020-09-14T15:54:35.000Z | 2020-09-14T15:54:35.000Z | flask_restx/marshalling.py | TVLIgnacy/flask-restx | 3614028ad498259faf257c1c869c5634e85ed042 | [
"BSD-3-Clause"
] | 1 | 2020-02-12T11:22:16.000Z | 2020-02-12T11:22:16.000Z | flask_restx/marshalling.py | TVLIgnacy/flask-restx | 3614028ad498259faf257c1c869c5634e85ed042 | [
"BSD-3-Clause"
] | 1 | 2020-05-25T14:22:44.000Z | 2020-05-25T14:22:44.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from collections import OrderedDict
from functools import wraps
from six import iteritems
from flask import request, current_app, has_app_context
from .mask import Mask, apply as apply_mask
from .utils import unpack
def make(cls):
if isinstance(cl... | 32.080645 | 88 | 0.538864 |
from __future__ import unicode_literals
from collections import OrderedDict
from functools import wraps
from six import iteritems
from flask import request, current_app, has_app_context
from .mask import Mask, apply as apply_mask
from .utils import unpack
def make(cls):
if isinstance(cls, type):
retur... | true | true |
1c1e9d00862498612a615070eb86314fe720815d | 904 | py | Python | aristoptimiser/aristo_memory.py | christos-tsotskas/aristoptimiser | 76ceaa965e8d5145e9816f737a2a7955fb8671e3 | [
"Apache-2.0"
] | 1 | 2022-03-09T15:13:01.000Z | 2022-03-09T15:13:01.000Z | aristoptimiser/aristo_memory.py | christos-tsotskas/aristoptimiser | 76ceaa965e8d5145e9816f737a2a7955fb8671e3 | [
"Apache-2.0"
] | 5 | 2020-04-12T20:22:07.000Z | 2020-04-19T23:50:23.000Z | aristoptimiser/aristo_memory.py | christos-tsotskas/aristoptimiser | 76ceaa965e8d5145e9816f737a2a7955fb8671e3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2020-present Christos Tsotskas
aristo_memory, part of aristoptimiser, https://github.com/christos-tsotskas/aristoptimiser
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You ma... | 29.16129 | 90 | 0.765487 |
__author__ = 'Christos Tsotskas'
__copyright__ = 'Copyright 2020, Aristo'
__credits__ = ['{credit_list}']
__license__ = 'Apache'
__version__ = '0.1.0'
__maintainer__ = 'Christos Tsotskas'
__email__ = 'c.tsotskas@gmail.com'
__status__ = 'Prototype' | true | true |
1c1e9dc44474e1be8878742fc53303f6a2ac2dbe | 2,736 | py | Python | backend/pyrogram/raw/types/help/terms_of_service_update.py | appheap/social-media-analyzer | 0f9da098bfb0b4f9eb38e0244aa3a168cf97d51c | [
"Apache-2.0"
] | 5 | 2021-09-11T22:01:15.000Z | 2022-03-16T21:33:42.000Z | backend/pyrogram/raw/types/help/terms_of_service_update.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | null | null | null | backend/pyrogram/raw/types/help/terms_of_service_update.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | 3 | 2022-01-18T11:06:22.000Z | 2022-02-26T13:39:28.000Z | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 32.963855 | 105 | 0.650585 |
from io import BytesIO
from pyrogram.raw.core.primitives import Int, Long, Int128, Int256, Bool, Bytes, String, Double, Vector
from pyrogram.raw.core import TLObject
from pyrogram import raw
from typing import List, Union, Any
| true | true |
1c1e9dc7104afe09d9927eef84af8c01062895f4 | 10,316 | py | Python | tests/test_core/test_annotation.py | GavinHuttley/c3test | c5bf7f8252b4f7b75a851e28275536a8c378897a | [
"BSD-3-Clause"
] | null | null | null | tests/test_core/test_annotation.py | GavinHuttley/c3test | c5bf7f8252b4f7b75a851e28275536a8c378897a | [
"BSD-3-Clause"
] | null | null | null | tests/test_core/test_annotation.py | GavinHuttley/c3test | c5bf7f8252b4f7b75a851e28275536a8c378897a | [
"BSD-3-Clause"
] | 1 | 2020-05-04T02:44:00.000Z | 2020-05-04T02:44:00.000Z | #!/usr/bin/env python
import unittest
from cogent3 import DNA, make_aligned_seqs
from cogent3.core.annotation import Feature, Variable, _Feature
from cogent3.core.location import Map, Span, as_map
from cogent3.core.sequence import DnaSequence, RnaSequence
__author__ = "Gavin Huttley"
__copyright__ = "Copyright 2007... | 41.596774 | 88 | 0.574738 |
import unittest
from cogent3 import DNA, make_aligned_seqs
from cogent3.core.annotation import Feature, Variable, _Feature
from cogent3.core.location import Map, Span, as_map
from cogent3.core.sequence import DnaSequence, RnaSequence
__author__ = "Gavin Huttley"
__copyright__ = "Copyright 2007-2020, The Cogent Pro... | true | true |
1c1e9ddf304d75d467cc1cfe858acd0582490360 | 1,098 | py | Python | parsl/tests/test_data/test_file.py | benclifford/parsl | 21f8681882779050d2e074591e95ada43789748f | [
"Apache-2.0"
] | null | null | null | parsl/tests/test_data/test_file.py | benclifford/parsl | 21f8681882779050d2e074591e95ada43789748f | [
"Apache-2.0"
] | null | null | null | parsl/tests/test_data/test_file.py | benclifford/parsl | 21f8681882779050d2e074591e95ada43789748f | [
"Apache-2.0"
] | null | null | null | import os
import pytest
from parsl.data_provider.files import File
import parsl
from parsl.tests.configs.local_threads import config
parsl.clear()
dfk = parsl.load(config)
@pytest.mark.local
def test_files():
fp = os.path.abspath('test_file.py')
strings = [{'f': 'file:///test_file.py', 'scheme': 'file', 'p... | 25.534884 | 94 | 0.577413 | import os
import pytest
from parsl.data_provider.files import File
import parsl
from parsl.tests.configs.local_threads import config
parsl.clear()
dfk = parsl.load(config)
@pytest.mark.local
def test_files():
fp = os.path.abspath('test_file.py')
strings = [{'f': 'file:///test_file.py', 'scheme': 'file', 'p... | true | true |
1c1e9e429f2997a49062eafaf7869e8ca2f63bd4 | 1,709 | py | Python | app/core/migrations/0001_initial.py | nuruddinsayeed/Basic_RESTapi_TDD_PracticewithDjango | a8aed5a38a1309604220b7ee435c710aace6ffcb | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | nuruddinsayeed/Basic_RESTapi_TDD_PracticewithDjango | a8aed5a38a1309604220b7ee435c710aace6ffcb | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | nuruddinsayeed/Basic_RESTapi_TDD_PracticewithDjango | a8aed5a38a1309604220b7ee435c710aace6ffcb | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-20 18:46
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
... | 50.264706 | 266 | 0.63897 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.A... | true | true |
1c1e9f2aa49dc31eb17cdd0f1c5cac78cb9440a2 | 175 | py | Python | 06-modules/modules_01/utility.py | ralexrivero/python_fundation | 34a855db7380d3d91db6a8f02d97f287d038ef5f | [
"Apache-2.0"
] | 1 | 2021-09-19T04:09:48.000Z | 2021-09-19T04:09:48.000Z | 06-modules/modules_01/utility.py | ralexrivero/python_fundation | 34a855db7380d3d91db6a8f02d97f287d038ef5f | [
"Apache-2.0"
] | null | null | null | 06-modules/modules_01/utility.py | ralexrivero/python_fundation | 34a855db7380d3d91db6a8f02d97f287d038ef5f | [
"Apache-2.0"
] | null | null | null | print("In utility: ")
def mul(num1, num2):
return num1 * num2
def divide(num1, num2):
return num1 / num2
class Student():
pass
st1 = Student()
print(type(st1)) | 13.461538 | 23 | 0.634286 | print("In utility: ")
def mul(num1, num2):
return num1 * num2
def divide(num1, num2):
return num1 / num2
class Student():
pass
st1 = Student()
print(type(st1)) | true | true |
1c1e9f6427b104c7e3d7e723c08c1027e676c679 | 3,688 | py | Python | contrast/cam.py | lightwisemax/diabetic-retinopathy-pytorch | a0710a00e5e4d5f220de66cb10dc34fd691be4a1 | [
"Apache-2.0"
] | null | null | null | contrast/cam.py | lightwisemax/diabetic-retinopathy-pytorch | a0710a00e5e4d5f220de66cb10dc34fd691be4a1 | [
"Apache-2.0"
] | null | null | null | contrast/cam.py | lightwisemax/diabetic-retinopathy-pytorch | a0710a00e5e4d5f220de66cb10dc34fd691be4a1 | [
"Apache-2.0"
] | 1 | 2019-05-03T02:38:15.000Z | 2019-05-03T02:38:15.000Z | import torch
import sys
import os
from PIL import Image
from torchvision import transforms
from torch.nn import functional as F
import numpy as np
import cv2
sys.path.append('../')
from networks.resnet import resnet18
from utils.util import add_prefix, remove_prefix, mkdir
def load_pretrained_model(prefix):
ch... | 32.350877 | 102 | 0.619577 | import torch
import sys
import os
from PIL import Image
from torchvision import transforms
from torch.nn import functional as F
import numpy as np
import cv2
sys.path.append('../')
from networks.resnet import resnet18
from utils.util import add_prefix, remove_prefix, mkdir
def load_pretrained_model(prefix):
ch... | true | true |
1c1ea03f8d802908474ad27a05bbc22ec8ae864a | 22 | py | Python | hello_world.py | pralakxavier/profiles-rest-api | 651f2c8181243950647cd557e4b7d958707d8a60 | [
"MIT"
] | null | null | null | hello_world.py | pralakxavier/profiles-rest-api | 651f2c8181243950647cd557e4b7d958707d8a60 | [
"MIT"
] | 7 | 2020-06-06T01:52:34.000Z | 2022-02-10T10:22:10.000Z | hello_world.py | pralakxavier/profiles-rest-api | 651f2c8181243950647cd557e4b7d958707d8a60 | [
"MIT"
] | null | null | null | print("Hello Fucker")
| 11 | 21 | 0.727273 | print("Hello Fucker")
| true | true |
1c1ea09b4318cd17768c04ff1a94abe79084b500 | 9,516 | py | Python | test/test_tomopy/test_recon/test_algorithm.py | aps-7bm/tomopy | ccf2cfa2df1aba8987e7a8827ac360d0b5534c55 | [
"BSD-3-Clause"
] | 2 | 2017-01-26T15:53:27.000Z | 2017-02-07T22:31:12.000Z | test/test_tomopy/test_recon/test_algorithm.py | aps-7bm/tomopy | ccf2cfa2df1aba8987e7a8827ac360d0b5534c55 | [
"BSD-3-Clause"
] | null | null | null | test/test_tomopy/test_recon/test_algorithm.py | aps-7bm/tomopy | ccf2cfa2df1aba8987e7a8827ac360d0b5534c55 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# #########################################################################
# Copyright (c) 2015-2019, UChicago Argonne, LLC. All rights reserved. #
# #
# Copyright 2015-2019. UChicago Argonne, LLC.... | 46.647059 | 82 | 0.594578 |
self):
result = recon(self.prj, self.ang, algorithm='sirt', num_iter=4,
accelerated=True, device='gpu', ncore=1, pool_size=3)
assert_allclose(result, read_file('sirt_accel_gpu.npy'), rtol=1e-2)
def test_tv(self):
assert_allclose(
recon(self.prj, self.an... | true | true |
1c1ea0a4d2665675d24edc54cc25e0f9a896c46c | 14,541 | py | Python | swift/account/server.py | aristanetworks/swift | 9fe774840e75cc54f2e0302e1e4501807fdb8b3c | [
"Apache-2.0"
] | null | null | null | swift/account/server.py | aristanetworks/swift | 9fe774840e75cc54f2e0302e1e4501807fdb8b3c | [
"Apache-2.0"
] | null | null | null | swift/account/server.py | aristanetworks/swift | 9fe774840e75cc54f2e0302e1e4501807fdb8b3c | [
"Apache-2.0"
] | 1 | 2020-06-05T08:07:09.000Z | 2020-06-05T08:07:09.000Z | # Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... | 45.583072 | 79 | 0.593425 |
import os
import time
import traceback
from swift import gettext_ as _
from eventlet import Timeout
import swift.common.db
from swift.account.backend import AccountBroker
from swift.account.utils import account_listing_response
from swift.common.db import DatabaseConnectionError, DatabaseAlreadyExists
... | true | true |
1c1ea0f620abdcd88f6c2397d2137511e680697d | 231 | py | Python | pyvivintsky/vivint_unknown_device.py | 7ooL/pyvivintsky | 2a2286e1b568434324b8f2cecb3a740ba8fd15f5 | [
"MIT"
] | 1 | 2020-12-05T19:39:22.000Z | 2020-12-05T19:39:22.000Z | pyvivintsky/vivint_unknown_device.py | 7ooL/pyvivintsky | 2a2286e1b568434324b8f2cecb3a740ba8fd15f5 | [
"MIT"
] | null | null | null | pyvivintsky/vivint_unknown_device.py | 7ooL/pyvivintsky | 2a2286e1b568434324b8f2cecb3a740ba8fd15f5 | [
"MIT"
] | 2 | 2020-12-05T19:39:31.000Z | 2021-01-11T17:04:32.000Z | from homeauto.api_vivint.pyvivintsky.vivint_device import VivintDevice
class VivintUnknownDevice(VivintDevice):
"""Represents an unknown device"""
def __init__(self, device, root):
super().__init__(device, root)
| 25.666667 | 70 | 0.748918 | from homeauto.api_vivint.pyvivintsky.vivint_device import VivintDevice
class VivintUnknownDevice(VivintDevice):
def __init__(self, device, root):
super().__init__(device, root)
| true | true |
1c1ea112c26f71815aaf335fa8d42b3e22449bf9 | 72 | py | Python | assignments/assignment2/untitled.py | vandedok/dlcourse_ai | b5ef97029980d3e9b5f75e3cf0b43762fc53ca2f | [
"MIT"
] | null | null | null | assignments/assignment2/untitled.py | vandedok/dlcourse_ai | b5ef97029980d3e9b5f75e3cf0b43762fc53ca2f | [
"MIT"
] | null | null | null | assignments/assignment2/untitled.py | vandedok/dlcourse_ai | b5ef97029980d3e9b5f75e3cf0b43762fc53ca2f | [
"MIT"
] | null | null | null | for i in []:
a = 1
b = 4
for x in []:
a=1
dictie = {
} | 7.2 | 12 | 0.333333 | for i in []:
a = 1
b = 4
for x in []:
a=1
dictie = {
} | true | true |
1c1ea2da4e28516050a105d7736985a6a3419e63 | 1,066 | py | Python | wstools/ht_api_test.py | inductiveload/wstools | b354a642b10a8d1bfa2a7683d2270c42512cb25d | [
"MIT"
] | null | null | null | wstools/ht_api_test.py | inductiveload/wstools | b354a642b10a8d1bfa2a7683d2270c42512cb25d | [
"MIT"
] | null | null | null | wstools/ht_api_test.py | inductiveload/wstools | b354a642b10a8d1bfa2a7683d2270c42512cb25d | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import argparse
import logging
import json
import utils.ht_api as HTAPI
import utils.pagelist as PL
def main():
parser = argparse.ArgumentParser(description='')
parser.add_argument('-v', '--verbose', action='store_true',
help='show debugging information')
... | 20.113208 | 63 | 0.56848 |
import argparse
import logging
import json
import utils.ht_api as HTAPI
import utils.pagelist as PL
def main():
parser = argparse.ArgumentParser(description='')
parser.add_argument('-v', '--verbose', action='store_true',
help='show debugging information')
parser.add_argument('... | true | true |
1c1ea40505ddb67b429db6b16bfc5352fdfb0485 | 1,755 | py | Python | inference/model_offload.py | craffel/t-zero | 11f42bf6880a85ee72d4415e53b5054d42f4aa0b | [
"Apache-2.0"
] | 90 | 2021-12-13T18:56:29.000Z | 2022-03-30T00:02:58.000Z | inference/model_offload.py | craffel/t-zero | 11f42bf6880a85ee72d4415e53b5054d42f4aa0b | [
"Apache-2.0"
] | 16 | 2021-12-21T16:31:42.000Z | 2022-03-24T13:01:28.000Z | inference/model_offload.py | craffel/t-zero | 11f42bf6880a85ee72d4415e53b5054d42f4aa0b | [
"Apache-2.0"
] | 19 | 2021-12-19T22:18:09.000Z | 2022-03-28T21:29:30.000Z | # coding=utf-8
"""
Script showcasing how to run inference of T0++ on a single GPU using offloading.
It relies on Deepspeed (https://github.com/microsoft/DeepSpeed) and the ZeRO-3 offloading implementation.
The script is adapted from https://huggingface.co/transformers/main_classes/deepspeed.html#non-trainer-deepspeed... | 30.258621 | 166 | 0.735043 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
from transformers.deepspeed import HfDeepSpeedConfig
import deepspeed
import os
import torch
os.environ["TOKENIZERS_PARALLELISM"] = "false"
model_name = "bigscience/T0pp"
ds_config = {
"fp16": {
"enabled": False,
},
"zero_optimiza... | true | true |
1c1ea4985c1f37bd1867c6eec9294d607d14d345 | 13,196 | py | Python | tools/log-util.py | leightonearl/SDK | e007db27fedbeffb98723f3e69964772909119b1 | [
"BSD-4-Clause"
] | 16 | 2019-03-06T05:47:48.000Z | 2021-09-08T08:00:45.000Z | tools/log-util.py | leightonearl/SDK | e007db27fedbeffb98723f3e69964772909119b1 | [
"BSD-4-Clause"
] | 1 | 2021-12-09T03:33:12.000Z | 2021-12-09T04:11:12.000Z | tools/log-util.py | leightonearl/SDK | e007db27fedbeffb98723f3e69964772909119b1 | [
"BSD-4-Clause"
] | 11 | 2019-03-05T22:51:21.000Z | 2022-03-02T05:47:55.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2020, Myriota Pty Ltd, All Rights Reserved
# SPDX-License-Identifier: BSD-3-Clause-Attribution
#
# This file is licensed under the BSD with attribution (the "License"); you
# may not use these files except in compliance with the License.
#
# You may ob... | 28.439655 | 87 | 0.526978 |
from __future__ import print_function
import sys
import struct
import time
import serial
import serial.tools.list_ports
import argparse
import binascii
import signal
errors = {
0: "Internal test",
1: "Factory reset",
2: "Watchdog reset",
3: "System states",
4: "MCU faults",
5: "... | true | true |
1c1ea4a216f3eac9134f13fc1c9e25408c03322f | 1,798 | py | Python | dataloaders/__init__.py | mukaman84/pytorch-template | 03c24724e084fab99a859202d4c98f2a34cdba22 | [
"MIT"
] | null | null | null | dataloaders/__init__.py | mukaman84/pytorch-template | 03c24724e084fab99a859202d4c98f2a34cdba22 | [
"MIT"
] | null | null | null | dataloaders/__init__.py | mukaman84/pytorch-template | 03c24724e084fab99a859202d4c98f2a34cdba22 | [
"MIT"
] | null | null | null | from dataloaders.datasets import cityscapes, combine_dbs
from dataloaders.datasets_lane import lane_mobis, lane_combine_dbs, Inference_data
from torch.utils.data import DataLoader
def make_data_loader(args, **kwargs):
if args.dataset == 'cityscapes':
train_set = cityscapes.CityscapesSegmentation(args, spli... | 48.594595 | 96 | 0.72525 | from dataloaders.datasets import cityscapes, combine_dbs
from dataloaders.datasets_lane import lane_mobis, lane_combine_dbs, Inference_data
from torch.utils.data import DataLoader
def make_data_loader(args, **kwargs):
if args.dataset == 'cityscapes':
train_set = cityscapes.CityscapesSegmentation(args, spli... | true | true |
1c1ea5697e694162b538fa6159f541b664558108 | 1,247 | py | Python | pyclesperanto_prototype/_tier1/_average_distance_of_n_shortest_distances.py | cavenel/pyclesperanto_prototype | 701f8b6741833d1943b4b78a28b1f0b06a5519b4 | [
"BSD-3-Clause"
] | 2 | 2020-07-01T06:20:44.000Z | 2020-07-01T09:36:48.000Z | pyclesperanto_prototype/_tier1/_average_distance_of_n_shortest_distances.py | cavenel/pyclesperanto_prototype | 701f8b6741833d1943b4b78a28b1f0b06a5519b4 | [
"BSD-3-Clause"
] | null | null | null | pyclesperanto_prototype/_tier1/_average_distance_of_n_shortest_distances.py | cavenel/pyclesperanto_prototype | 701f8b6741833d1943b4b78a28b1f0b06a5519b4 | [
"BSD-3-Clause"
] | 1 | 2020-06-29T18:40:54.000Z | 2020-06-29T18:40:54.000Z | from .._tier0 import execute
from .._tier0 import plugin_function
from .._tier0 import Image
from .._tier0 import create_vector_from_square_matrix
@plugin_function(output_creator=create_vector_from_square_matrix)
def average_distance_of_n_shortest_distances(distance_matrix : Image, distance_vector_destination: Image =... | 32.815789 | 135 | 0.736167 | from .._tier0 import execute
from .._tier0 import plugin_function
from .._tier0 import Image
from .._tier0 import create_vector_from_square_matrix
@plugin_function(output_creator=create_vector_from_square_matrix)
def average_distance_of_n_shortest_distances(distance_matrix : Image, distance_vector_destination: Image =... | true | true |
1c1ea5d573e366849c7bed6c741c42aa8f7e60a3 | 411 | py | Python | main/migrations/0024_domain_price.py | lotrekagency/handyman | 55a1215347e309401a40be3c3774e48cc318003e | [
"MIT"
] | 2 | 2019-09-08T14:48:34.000Z | 2022-01-31T11:51:47.000Z | main/migrations/0024_domain_price.py | lotrekagency/handyman | 55a1215347e309401a40be3c3774e48cc318003e | [
"MIT"
] | 5 | 2020-06-05T17:16:45.000Z | 2022-02-03T15:40:26.000Z | main/migrations/0024_domain_price.py | lotrekagency/handyman | 55a1215347e309401a40be3c3774e48cc318003e | [
"MIT"
] | 1 | 2021-06-19T08:33:00.000Z | 2021-06-19T08:33:00.000Z | # Generated by Django 2.2.5 on 2019-12-06 10:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0023_domain'),
]
operations = [
migrations.AddField(
model_name='domain',
name='price',
field=mo... | 21.631579 | 93 | 0.600973 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0023_domain'),
]
operations = [
migrations.AddField(
model_name='domain',
name='price',
field=models.DecimalField(blank=True, decimal_places=2,... | true | true |
1c1ea684c1e1a004be43b1f151047f4ed2dfab83 | 874 | py | Python | homeassistant/components/dublin_luas/__init__.py | mullerla/core | 5c372048340d8b9f930e38af7152ba38ca200ca7 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/dublin_luas/__init__.py | mullerla/core | 5c372048340d8b9f930e38af7152ba38ca200ca7 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/dublin_luas/__init__.py | mullerla/core | 5c372048340d8b9f930e38af7152ba38ca200ca7 | [
"Apache-2.0"
] | null | null | null | """The Dublin Luas integration."""
from __future__ import annotations
from luas.api import LuasClient, LuasDirection, LuasLine
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from .const import DOMAIN
PLATFORMS: list[str] = ["sensor"]
async def async_setup_entry(h... | 28.193548 | 82 | 0.750572 | from __future__ import annotations
from luas.api import LuasClient, LuasDirection, LuasLine
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from .const import DOMAIN
PLATFORMS: list[str] = ["sensor"]
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEn... | true | true |
1c1ea75d6d531949902f56d3a292c400d806ceda | 875 | py | Python | tests/conftest.py | Alviner/aiohttp-s3-client | ca0944aaad442af54019355c9e8c076eca7ee33f | [
"Apache-2.0"
] | 7 | 2021-03-17T19:51:51.000Z | 2021-08-23T09:57:35.000Z | tests/conftest.py | Alviner/aiohttp-s3-client | ca0944aaad442af54019355c9e8c076eca7ee33f | [
"Apache-2.0"
] | 1 | 2021-03-26T14:29:33.000Z | 2021-03-26T14:29:33.000Z | tests/conftest.py | Alviner/aiohttp-s3-client | ca0944aaad442af54019355c9e8c076eca7ee33f | [
"Apache-2.0"
] | 4 | 2021-03-26T14:21:06.000Z | 2021-08-23T10:01:54.000Z | import os
from typing import Optional
import pytest
from aiohttp import ClientSession
from yarl import URL
from aiohttp_s3_client import S3Client
@pytest.fixture
async def s3_client(loop, s3_url: URL):
async with ClientSession(
raise_for_status=False, auto_decompress=False,
) as session:
yie... | 21.341463 | 73 | 0.686857 | import os
from typing import Optional
import pytest
from aiohttp import ClientSession
from yarl import URL
from aiohttp_s3_client import S3Client
@pytest.fixture
async def s3_client(loop, s3_url: URL):
async with ClientSession(
raise_for_status=False, auto_decompress=False,
) as session:
yie... | true | true |
1c1ea996b5fcef3acdd138693ed935ce6295e9f2 | 6,020 | py | Python | smspdu/elements.py | sysnux/smspdu | 0c0d24785285e04613ae94a5da8d78fee4af2e14 | [
"MIT"
] | null | null | null | smspdu/elements.py | sysnux/smspdu | 0c0d24785285e04613ae94a5da8d78fee4af2e14 | [
"MIT"
] | null | null | null | smspdu/elements.py | sysnux/smspdu | 0c0d24785285e04613ae94a5da8d78fee4af2e14 | [
"MIT"
] | null | null | null | # coding: utf-8
# Copyright (c) Qotto, 2018
"""
Various elements used in TP-DU, according to GSM 03.40.
All these elements are encoded in strings and decoded in native Python objects.
"""
import pytz
from bitstring import BitStream
from datetime import datetime
from datetime import timedelta
from datetime import ti... | 28.130841 | 98 | 0.568937 |
import pytz
from bitstring import BitStream
from datetime import datetime
from datetime import timedelta
from datetime import timezone
from io import StringIO
from typing import Any, Dict
__all__ = ['Date', 'Number', 'TypeOfAddress']
def swap_nibbles(data: str) -> str:
res = ''
for k in range(0, len(dat... | true | true |
1c1eaa86129a43416044168d9f7f28d5dd46b9f3 | 4,041 | py | Python | Validation/RecoParticleFlow/python/particleFlowDQM_cff.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | Validation/RecoParticleFlow/python/particleFlowDQM_cff.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | Validation/RecoParticleFlow/python/particleFlowDQM_cff.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
import Validation.RecoParticleFlow.defaults_cfi as default
from Validation.RecoParticleFlow.defaults_cfi import ptbins, etabins, response_distribution_name, genjet_distribution_name,jetResponseDir,genjetDir
#----- ----- ----- ----- ----- ----- ----- -----
#
# Auxiliary definiti... | 36.736364 | 160 | 0.654046 | import FWCore.ParameterSet.Config as cms
import Validation.RecoParticleFlow.defaults_cfi as default
from Validation.RecoParticleFlow.defaults_cfi import ptbins, etabins, response_distribution_name, genjet_distribution_name,jetResponseDir,genjetDir
def make_response_plot_pset(name, title, responseNbins, responseLo... | true | true |
1c1eaa93618a60f23e6c664112465062d6145dfc | 382 | py | Python | app/core/migrations/0002_user_name.py | Ivanrputra/recipe-app-api | e70548a4f7f8756f8f4224dcf39b809a8b546da1 | [
"MIT"
] | null | null | null | app/core/migrations/0002_user_name.py | Ivanrputra/recipe-app-api | e70548a4f7f8756f8f4224dcf39b809a8b546da1 | [
"MIT"
] | null | null | null | app/core/migrations/0002_user_name.py | Ivanrputra/recipe-app-api | e70548a4f7f8756f8f4224dcf39b809a8b546da1 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.14 on 2019-11-11 08:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='name',
field=mod... | 20.105263 | 65 | 0.586387 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='name',
field=models.CharField(default=None, max_length=256),
... | true | true |
1c1eaa99c37a2308ea84d199f0371553dd653f21 | 29,408 | py | Python | sympy/ntheory/generate.py | faze-geek/sympy | 69662b4fb4a9c585742da50ff33c5ba896108f23 | [
"BSD-3-Clause"
] | null | null | null | sympy/ntheory/generate.py | faze-geek/sympy | 69662b4fb4a9c585742da50ff33c5ba896108f23 | [
"BSD-3-Clause"
] | null | null | null | sympy/ntheory/generate.py | faze-geek/sympy | 69662b4fb4a9c585742da50ff33c5ba896108f23 | [
"BSD-3-Clause"
] | null | null | null | """
Generating and counting primes.
"""
import random
from bisect import bisect
from itertools import count
# Using arrays for sieving instead of lists greatly reduces
# memory consumption
from array import array as _array
from sympy.core.function import Function
from sympy.core.singleton import S
from .primetest im... | 28.331407 | 120 | 0.512004 |
import random
from bisect import bisect
from itertools import count
from array import array as _array
from sympy.core.function import Function
from sympy.core.singleton import S
from .primetest import isprime
from sympy.utilities.misc import as_int
def _azeros(n):
return _array('l', [0]*n)
def _aset(*v):
... | true | true |
1c1eabddfe51b5ce2d04210c0469dae27588e11b | 1,302 | py | Python | tbans/models/subscriptions/subscription_status.py | BookWorm0103/the-blue-alliance | 39b2f33531308b19218d58c726d51f020ee9d8b5 | [
"MIT"
] | null | null | null | tbans/models/subscriptions/subscription_status.py | BookWorm0103/the-blue-alliance | 39b2f33531308b19218d58c726d51f020ee9d8b5 | [
"MIT"
] | null | null | null | tbans/models/subscriptions/subscription_status.py | BookWorm0103/the-blue-alliance | 39b2f33531308b19218d58c726d51f020ee9d8b5 | [
"MIT"
] | null | null | null | from tbans.models.subscriptions.subscription_response import SubscriptionResponse
class SubscriptionStatus(SubscriptionResponse):
""" Representation of a subscriber's status from the Instance ID status API.
Attributes:
subscriptions: (list, string): List of topics the user is subscribed to - may be e... | 32.55 | 132 | 0.572197 | from tbans.models.subscriptions.subscription_response import SubscriptionResponse
class SubscriptionStatus(SubscriptionResponse):
def __init__(self, response=None, error=None):
super(SubscriptionStatus, self).__init__(response=response, error=error)
relations = self.data.get('rel', {})
to... | true | true |
1c1eacb4ef9b703eec85ae297610d44dcdbdd207 | 2,582 | py | Python | samples/snippets/create_training_pipeline_video_object_tracking_sample_test.py | telpirion/python-aiplatform | 5155dee5edd86fb700a91dfca01bddd4d6393410 | [
"Apache-2.0"
] | null | null | null | samples/snippets/create_training_pipeline_video_object_tracking_sample_test.py | telpirion/python-aiplatform | 5155dee5edd86fb700a91dfca01bddd4d6393410 | [
"Apache-2.0"
] | null | null | null | samples/snippets/create_training_pipeline_video_object_tracking_sample_test.py | telpirion/python-aiplatform | 5155dee5edd86fb700a91dfca01bddd4d6393410 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 31.487805 | 112 | 0.77653 |
from uuid import uuid4
import pytest
import os
import helpers
import create_training_pipeline_video_object_tracking_sample
import cancel_training_pipeline_sample
import delete_training_pipeline_sample
from google.cloud import aiplatform
PROJECT_ID = os.getenv("BUILD_SPECIFIC_GCLOUD_PROJECT")
DATASET_I... | true | true |
1c1eadde04248bcfa0ae7596ef66cdf00e8d5838 | 10,846 | py | Python | molvs/charge.py | EBjerrum/MolVS | df2040f0a7fec2843e01e46409cb8a59a926d7ba | [
"MIT"
] | null | null | null | molvs/charge.py | EBjerrum/MolVS | df2040f0a7fec2843e01e46409cb8a59a926d7ba | [
"MIT"
] | null | null | null | molvs/charge.py | EBjerrum/MolVS | df2040f0a7fec2843e01e46409cb8a59a926d7ba | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
molvs.charge
~~~~~~~~~~~~
This module implements tools for manipulating charges on molecules. In particular, :class:`~molvs.charge.Reionizer`,
which competitively reionizes acids such that the strongest acids ionize first, and :class:`~molvs.charge.Uncharger`,
which attempts to neutralize i... | 47.156522 | 120 | 0.620229 |
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import copy
import logging
from rdkit import Chem
from .utils import memoized_property
log = logging.getLogger(__name__)
class AcidBasePair(object):
def __init__(self, name, acid, base):
lo... | true | true |
1c1eae30a60df053944f0c5fff82593b5116f6d8 | 2,584 | py | Python | wam/apps/vdr/views.py | laozhudetui/wam | 3101dae034344ec255c9f3dd165d2aae6b3bea95 | [
"MIT"
] | 227 | 2018-08-25T12:50:30.000Z | 2022-03-31T11:18:33.000Z | wam/apps/vdr/views.py | laozhudetui/wam | 3101dae034344ec255c9f3dd165d2aae6b3bea95 | [
"MIT"
] | 1 | 2018-09-02T07:51:32.000Z | 2018-09-03T00:29:45.000Z | wam/apps/vdr/views.py | laozhudetui/wam | 3101dae034344ec255c9f3dd165d2aae6b3bea95 | [
"MIT"
] | 48 | 2018-08-25T13:57:52.000Z | 2022-01-10T15:59:27.000Z | #!/usr/bin/env python
# coding: utf8
# author: $pdb & $vim
# django modules
from django.db.models import Q
from django.shortcuts import render, HttpResponse
from django.contrib.auth.decorators import login_required
# wam modules
from wam.settings import WAM_VENDOR_LOGO_URL
from wam.apps.am.models import Vendor, Rule,... | 36.394366 | 93 | 0.667183 |
from django.db.models import Q
from django.shortcuts import render, HttpResponse
from django.contrib.auth.decorators import login_required
from wam.settings import WAM_VENDOR_LOGO_URL
from wam.apps.am.models import Vendor, Rule, Diff, Package
@login_required(login_url='/login/')
def index_view(request):
""... | false | true |
1c1eae38e825e7650d4b3fca1161a3496c555822 | 915 | py | Python | scylla/providers/plain_text_provider.py | IMULMUL/scylla | 05410869ad99a33eb56e50a47ab23ed7877db73e | [
"Apache-2.0"
] | 1 | 2021-02-26T05:01:17.000Z | 2021-02-26T05:01:17.000Z | scylla/providers/plain_text_provider.py | IMULMUL/scylla | 05410869ad99a33eb56e50a47ab23ed7877db73e | [
"Apache-2.0"
] | null | null | null | scylla/providers/plain_text_provider.py | IMULMUL/scylla | 05410869ad99a33eb56e50a47ab23ed7877db73e | [
"Apache-2.0"
] | null | null | null | import re
from requests_html import HTML
from scylla.database import ProxyIP
from .base_provider import BaseProvider
class PlainTextProvider(BaseProvider):
def urls(self) -> [str]:
return []
def parse(self, html: HTML) -> [ProxyIP]:
ip_list: [ProxyIP] = []
if html is None:
... | 24.72973 | 111 | 0.533333 | import re
from requests_html import HTML
from scylla.database import ProxyIP
from .base_provider import BaseProvider
class PlainTextProvider(BaseProvider):
def urls(self) -> [str]:
return []
def parse(self, html: HTML) -> [ProxyIP]:
ip_list: [ProxyIP] = []
if html is None:
... | true | true |
1c1eae3f9c4dfae04cb50e76caf0e2bcdb30f1a3 | 664 | py | Python | 519-DeepLearning/assignment1/Instructions.py | neale/CS-program | 6fef9c39579143bde0ab5d1ec5fedc7210e55814 | [
"Unlicense"
] | 1 | 2016-10-24T13:36:23.000Z | 2016-10-24T13:36:23.000Z | 519-DeepLearning/assignment1/Instructions.py | neale/CS-program | 6fef9c39579143bde0ab5d1ec5fedc7210e55814 | [
"Unlicense"
] | null | null | null | 519-DeepLearning/assignment1/Instructions.py | neale/CS-program | 6fef9c39579143bde0ab5d1ec5fedc7210e55814 | [
"Unlicense"
] | null | null | null | # Loading the data
# Now, the data should contain these items:
# dict["train_data"]: a 10000 x 3072 matrix with each row being a training image (you can visualize the image by reshaping the row to 32x32x3
# dict["train_labels"]: a 10000 x 1 vector with each row being the label of one training image, label 0 is an ai... | 55.333333 | 142 | 0.73494 |
import cPickle
dict = cPickle.load(open("cifar_2class_py2.p","rb"))
for i in dict:
print i, dict[i].shape | false | true |
1c1eaec49a62c83dc19e322a505e10c255da34cb | 1,418 | py | Python | geeksforgeeks/Dynamic Programming/edit_distance.py | codervikash/online-courses | a60efad23af65080a98e7dd038fb2c750237b781 | [
"MIT"
] | null | null | null | geeksforgeeks/Dynamic Programming/edit_distance.py | codervikash/online-courses | a60efad23af65080a98e7dd038fb2c750237b781 | [
"MIT"
] | null | null | null | geeksforgeeks/Dynamic Programming/edit_distance.py | codervikash/online-courses | a60efad23af65080a98e7dd038fb2c750237b781 | [
"MIT"
] | null | null | null | #!/usr/bin/python
def edit_distance(x, y, n, m):
if m == 0:
return n
if n == 0:
return m
if x[n - 1] == y[m - 1]:
return edit_distance(x, y, n - 1, m - 1)
return 1 + min(
edit_distance(x, y, n - 1, m),
edit_distance(x, y, n, m - 1),
edit_distance(x, y, n - 1, m - 1)
)
def edit_distance_dp_recur... | 22.15625 | 81 | 0.559238 |
def edit_distance(x, y, n, m):
if m == 0:
return n
if n == 0:
return m
if x[n - 1] == y[m - 1]:
return edit_distance(x, y, n - 1, m - 1)
return 1 + min(
edit_distance(x, y, n - 1, m),
edit_distance(x, y, n, m - 1),
edit_distance(x, y, n - 1, m - 1)
)
def edit_distance_dp_recursive(x, y, n, m):... | false | true |
1c1eaf14507536231a0f411324972d8d41376ccb | 15,239 | py | Python | indico/modules/events/registration/models/forms.py | DirkHoffmann/indico | 9aec42a5677fa3f26e52db5b44f771da2c896799 | [
"MIT"
] | null | null | null | indico/modules/events/registration/models/forms.py | DirkHoffmann/indico | 9aec42a5677fa3f26e52db5b44f771da2c896799 | [
"MIT"
] | 2 | 2015-01-20T22:25:18.000Z | 2020-07-20T15:27:20.000Z | indico/modules/events/registration/models/forms.py | andrea-guarino-sonarsource/indico | 2dada1f293daea913dec85ebb33c29a9f2cb92ac | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from uuid import UUID
from babel.numbers import format_currency
from flask import session
from sqlalchemy... | 33.056399 | 119 | 0.654308 |
from uuid import UUID
from babel.numbers import format_currency
from flask import session
from sqlalchemy import orm, select
from sqlalchemy.dialects.postgresql import ARRAY
from sqlalchemy.event import listens_for
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm import column_property, sub... | true | true |
1c1eafe4024bd04f8c408dfd230d655c9c5af0a9 | 4,917 | py | Python | tensorflow/python/compat/compat.py | suyash/tensorflow | 968d511ebf5fe5651752580a13e457498ebab50d | [
"Apache-2.0"
] | 1 | 2019-07-11T22:06:41.000Z | 2019-07-11T22:06:41.000Z | tensorflow/python/compat/compat.py | suyash/tensorflow | 968d511ebf5fe5651752580a13e457498ebab50d | [
"Apache-2.0"
] | null | null | null | tensorflow/python/compat/compat.py | suyash/tensorflow | 968d511ebf5fe5651752580a13e457498ebab50d | [
"Apache-2.0"
] | null | null | null | # 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... | 35.630435 | 80 | 0.737035 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import datetime
from tensorflow.python.util import tf_contextlib
from tensorflow.python.util.tf_export import tf_export
_FORWARD_COMPATIBILITY_HORIZON = datetime.date(2019, 7, 11)
@tf_export(... | true | true |
1c1eb23406a3f568d804fc896ab9b1f3f6aa5192 | 4,056 | py | Python | benchmark/startQiskit_Class839.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class839.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class839.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=40
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as ... | 30.727273 | 80 | 0.604043 |
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as nx
def build_oracle(n: int, f) -... | true | true |
1c1eb250fb96e7e121359b16d7ecab95318e8997 | 2,356 | py | Python | script/himax_driver.py | FullMetalNicky/PULP-Streamer | d26269aaeff28cf9adae7fb49dff9aa2bdebd40d | [
"MIT"
] | null | null | null | script/himax_driver.py | FullMetalNicky/PULP-Streamer | d26269aaeff28cf9adae7fb49dff9aa2bdebd40d | [
"MIT"
] | null | null | null | script/himax_driver.py | FullMetalNicky/PULP-Streamer | d26269aaeff28cf9adae7fb49dff9aa2bdebd40d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import fcntl
import os
import numpy as np
import rospy
from cv_bridge import CvBridge
from sensor_msgs.msg import Image
# import cv2
page_size = 655536 # 4092 # 8192 # 1024 # 4096
F_GETPIPE_SZ = 1032 # Linux 2.6.35+
F_SETPIPE_SZ = 1031 # Linux 2.6.35+
def read_from_pipe(pipein, size):
... | 31 | 82 | 0.610781 |
import fcntl
import os
import numpy as np
import rospy
from cv_bridge import CvBridge
from sensor_msgs.msg import Image
page_size = 655536 31
def read_from_pipe(pipein, size):
remaining_size = size
data = []
while(remaining_size > 0):
output = os.read(pipein, min(remain... | true | true |
1c1eb32dad6cc0fa0a93d29406ea4864ba93e54c | 1,326 | py | Python | make_maps.py | griffij/eq_hazmap_tests | db9d6202937b08b543758b8e190566116dbcf83b | [
"Apache-2.0"
] | 1 | 2021-12-03T16:55:03.000Z | 2021-12-03T16:55:03.000Z | make_maps.py | griffij/eq_hazmap_tests | db9d6202937b08b543758b8e190566116dbcf83b | [
"Apache-2.0"
] | null | null | null | make_maps.py | griffij/eq_hazmap_tests | db9d6202937b08b543758b8e190566116dbcf83b | [
"Apache-2.0"
] | 1 | 2019-10-12T09:55:31.000Z | 2019-10-12T09:55:31.000Z | """Plot all the figures at once
"""
import sys, os
from glob import glob
from pipes import quote
filelist = glob(os.path.join('outputs', '*1867*.csv'))
bbox_dict = {1699: '104/113/-9/-5',
1780: '104/113/-9/-5',
1834: '105/110/-8/-5',
1840: '105/115/-9/-5',
1847: '10... | 31.571429 | 79 | 0.564103 | """Plot all the figures at once
"""
import sys, os
from glob import glob
from pipes import quote
filelist = glob(os.path.join('outputs', '*1867*.csv'))
bbox_dict = {1699: '104/113/-9/-5',
1780: '104/113/-9/-5',
1834: '105/110/-8/-5',
1840: '105/115/-9/-5',
1847: '10... | false | true |
1c1eb74e1f63cc76643cbcdc4a98d9718c3daea7 | 349 | py | Python | scripts/Delete_contig_name.py | sergioSEa/NGS_mtc_quantification | 3a4890e9742204c23285fe2bc62009ea0f62ee71 | [
"MIT"
] | null | null | null | scripts/Delete_contig_name.py | sergioSEa/NGS_mtc_quantification | 3a4890e9742204c23285fe2bc62009ea0f62ee71 | [
"MIT"
] | null | null | null | scripts/Delete_contig_name.py | sergioSEa/NGS_mtc_quantification | 3a4890e9742204c23285fe2bc62009ea0f62ee71 | [
"MIT"
] | null | null | null | from Bio import SeqIO
import sys
Name = sys.argv[1]#"scaffold_4794"
assembly = sys.argv[2] #"Data/ncl_assemblies/B10K-DU-009-16.genomic.fa"
record = list(SeqIO.parse(assembly, "fasta"))
new_list = []
for r in record:
if Name == r.id: continue
else: new_list.append(r)
handle = open(assembly,"w")
SeqIO.writ... | 17.45 | 71 | 0.696275 | from Bio import SeqIO
import sys
Name = sys.argv[1]
assembly = sys.argv[2]
record = list(SeqIO.parse(assembly, "fasta"))
new_list = []
for r in record:
if Name == r.id: continue
else: new_list.append(r)
handle = open(assembly,"w")
SeqIO.write(new_list,handle,"fasta")
| true | true |
1c1eb78ede626c0e1c88c555e38359639c3c65ff | 1,441 | py | Python | src/django_bpp/settings/local.py | iplweb/bpp | f027415cc3faf1ca79082bf7bacd4be35b1a6fdf | [
"BSD-3-Clause"
] | null | null | null | src/django_bpp/settings/local.py | iplweb/bpp | f027415cc3faf1ca79082bf7bacd4be35b1a6fdf | [
"BSD-3-Clause"
] | 41 | 2019-11-07T00:07:02.000Z | 2022-02-27T22:09:39.000Z | src/django_bpp/settings/local.py | iplweb/bpp | f027415cc3faf1ca79082bf7bacd4be35b1a6fdf | [
"BSD-3-Clause"
] | null | null | null | # -*- encoding: utf-8 -*-
# Lokalny development (na moim Maku)
import os
def setenv_default(varname, default_value):
if os.environ.get(varname) is None:
os.environ[varname] = default_value
setenv_default("DJANGO_SETTINGS_MODULE", "django_bpp.settings.local")
setenv_default("DJANGO_BPP_SECRET_KEY", "0x... | 21.833333 | 83 | 0.723803 |
import os
def setenv_default(varname, default_value):
if os.environ.get(varname) is None:
os.environ[varname] = default_value
setenv_default("DJANGO_SETTINGS_MODULE", "django_bpp.settings.local")
setenv_default("DJANGO_BPP_SECRET_KEY", "0xdeadbeef 2")
from .base import *
from .base import DATABAS... | true | true |
1c1eb820405b6ed228d3cabf2d1700a7b5b22018 | 853 | py | Python | experiment_scripts/1-10-2021.py | alexlioralexli/TD3 | 2a9258c822f03b1334295acf9fbeb8170d213684 | [
"MIT"
] | null | null | null | experiment_scripts/1-10-2021.py | alexlioralexli/TD3 | 2a9258c822f03b1334295acf9fbeb8170d213684 | [
"MIT"
] | null | null | null | experiment_scripts/1-10-2021.py | alexlioralexli/TD3 | 2a9258c822f03b1334295acf9fbeb8170d213684 | [
"MIT"
] | null | null | null | """
- For Half Cheetah:
- try deeper MLPs
- FourierMLP: try different sigma values
- MLP, seeds 10-50, with 1 hidden and 2 hidden
- FourierMLP, sigma=0.01, 0.03, fourier_dim 256, 512, 1024, seeds 10-50
- concatenate, train_B, concatenate and train_B
- 200 total experiments
"""
exp_strings = []
# normal MLP
exp_str... | 32.807692 | 125 | 0.642438 | exp_strings = []
exp_strings.append('--n_hidden 3 --expID 9')
for type in ['--train_B --expID 10',
'--concatenate_fourier --train_B --expID 11']:
for n_hidden in [1, 2]:
for sigma in [0.0003, 0.001, 0.003, 0.006]:
exp_strings.append(f'--network_class FourierMLP {type} --n_hidden... | true | true |
1c1eb9b57769fe2c49ede1459bd1a35bb358cfe1 | 254 | py | Python | api/routers.py | vasmedvedev/welltory_test | 9dd1ea35850916a2203241798d0acd9415d762b7 | [
"MIT"
] | null | null | null | api/routers.py | vasmedvedev/welltory_test | 9dd1ea35850916a2203241798d0acd9415d762b7 | [
"MIT"
] | null | null | null | api/routers.py | vasmedvedev/welltory_test | 9dd1ea35850916a2203241798d0acd9415d762b7 | [
"MIT"
] | null | null | null | from rest_framework import routers
from api import views
router = routers.DefaultRouter()
router.register(r'sleep', views.SleepViewSet)
router.register(r'steps', views.StepsViewSet)
router.register(r'geo', views.GeoViewSet)
urlpatterns = router.urls
| 21.166667 | 45 | 0.799213 | from rest_framework import routers
from api import views
router = routers.DefaultRouter()
router.register(r'sleep', views.SleepViewSet)
router.register(r'steps', views.StepsViewSet)
router.register(r'geo', views.GeoViewSet)
urlpatterns = router.urls
| true | true |
1c1ebb16080e0d8944157995dc5b07534958e1bd | 9,876 | py | Python | stayhome/privsite/views.py | mageo/stayhomech | 5afe922b13f0350a79eaff0401709f99c5a31e8b | [
"MIT"
] | 3 | 2020-03-20T11:01:57.000Z | 2020-03-20T16:29:12.000Z | stayhome/privsite/views.py | stayhomech/stayhomech | 5afe922b13f0350a79eaff0401709f99c5a31e8b | [
"MIT"
] | 74 | 2020-03-23T21:35:07.000Z | 2020-04-27T12:55:50.000Z | stayhome/privsite/views.py | mageo/stayhomech | 5afe922b13f0350a79eaff0401709f99c5a31e8b | [
"MIT"
] | 3 | 2020-03-20T11:02:35.000Z | 2020-03-20T16:29:23.000Z | from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.views.generic import ListView, DetailView, RedirectView, View
from django.utils.translation import gettext_lazy as _
from django.utils.encoding import force_str
from django.shortcuts import redirec... | 33.0301 | 167 | 0.628392 | from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.views.generic import ListView, DetailView, RedirectView, View
from django.utils.translation import gettext_lazy as _
from django.utils.encoding import force_str
from django.shortcuts import redirec... | true | true |
1c1ebb6fb7ddff0961c3d9e225ccf8b45a35d40e | 31 | py | Python | forte/models/__init__.py | huzecong/forte | beae4e923c9a6873b582588972e6ec9919079271 | [
"Apache-2.0"
] | null | null | null | forte/models/__init__.py | huzecong/forte | beae4e923c9a6873b582588972e6ec9919079271 | [
"Apache-2.0"
] | null | null | null | forte/models/__init__.py | huzecong/forte | beae4e923c9a6873b582588972e6ec9919079271 | [
"Apache-2.0"
] | null | null | null | from forte.models.ner import *
| 15.5 | 30 | 0.774194 | from forte.models.ner import *
| true | true |
1c1ebbb81bfab4360aec6a06c3b6a8bf217d5ba9 | 1,133 | py | Python | fuzzy_logic/types.py | Luferov/FuzzyLogicToolBox | cacdc120aff78a07924333c2b61f10050a8db116 | [
"MIT"
] | 15 | 2020-03-21T18:22:13.000Z | 2022-01-24T21:17:46.000Z | fuzzy_logic/types.py | Luferov/FuzzyLogicToolBox | cacdc120aff78a07924333c2b61f10050a8db116 | [
"MIT"
] | null | null | null | fuzzy_logic/types.py | Luferov/FuzzyLogicToolBox | cacdc120aff78a07924333c2b61f10050a8db116 | [
"MIT"
] | 3 | 2021-03-18T18:25:41.000Z | 2022-01-20T07:24:01.000Z | """
Luferov Victor <lyferov@yandex.ru>
Types of smths
"""
from enum import Enum
class MfCompositionType(Enum):
"""
Type composition of mf
"""
MIN = 1
MAX = 2
PROD = 3
SUM = 4
class AndMethod(Enum):
"""
Method and
"""
MIN = 1 # min(a, b)
PROD = 2 # a * b
cla... | 14.525641 | 58 | 0.563989 |
from enum import Enum
class MfCompositionType(Enum):
MIN = 1
MAX = 2
PROD = 3
SUM = 4
class AndMethod(Enum):
MIN = 1
PROD = 2
class ImplicationMethod(Enum):
MIN = 1
PROD = 2
class OrMethod(Enum):
MAX = 1
PROB = 2
class AggregationMethod(Enum)... | true | true |
1c1ebc1a770e6f5123e3fa40d36b956d379a518e | 357 | py | Python | library/__ie6__/pyjamas/ui/Focus.py | certik/pyjamas | 5bb72e63e50f09743ac986f4c9690ba50c499ba9 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2018-09-19T09:14:16.000Z | 2018-09-19T09:14:16.000Z | library/__ie6__/pyjamas/ui/Focus.py | andreyvit/pyjamas | 1154abe3340a84dba7530b8174aaddecfc1a0944 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | library/__ie6__/pyjamas/ui/Focus.py | andreyvit/pyjamas | 1154abe3340a84dba7530b8174aaddecfc1a0944 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-08-13T20:32:25.000Z | 2019-08-13T20:32:25.000Z | # emulate behaviour of other browsers
def focus(elem):
JS("""
try {
elem.focus();
} catch (e) {
// Only trap the exception if the attempt was mostly legit
if (!elem || !elem.focus) {
// Rethrow the probable NPE or invalid type
throw... | 25.5 | 70 | 0.459384 |
def focus(elem):
JS("""
try {
elem.focus();
} catch (e) {
// Only trap the exception if the attempt was mostly legit
if (!elem || !elem.focus) {
// Rethrow the probable NPE or invalid type
throw e;
}
}
""")
| true | true |
1c1ebc8d6985771372f47363312f8223f5db63c6 | 76,692 | py | Python | main/src/pythonGenerator/pythonAutoGenerateObjects.py | eapcivil/EXUDYN | 52bddc8c258cda07e51373f68e1198b66c701d03 | [
"BSD-3-Clause-Open-MPI"
] | 1 | 2020-10-06T08:06:25.000Z | 2020-10-06T08:06:25.000Z | main/src/pythonGenerator/pythonAutoGenerateObjects.py | eapcivil/EXUDYN | 52bddc8c258cda07e51373f68e1198b66c701d03 | [
"BSD-3-Clause-Open-MPI"
] | null | null | null | main/src/pythonGenerator/pythonAutoGenerateObjects.py | eapcivil/EXUDYN | 52bddc8c258cda07e51373f68e1198b66c701d03 | [
"BSD-3-Clause-Open-MPI"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri May 18 08:53:30 2018
@author: Johannes Gerstmayr
goal: automatically generate interfaces for structures
currently: automatic generate structures with ostream and initialization
"""
from autoGenerateHelper import RemoveSpacesTabs, CountLines, TypeConversion, GenerateHeader, ... | 56.851001 | 302 | 0.532468 |
from autoGenerateHelper import RemoveSpacesTabs, CountLines, TypeConversion, GenerateHeader, SplitString, Str2Latex, DefaultValue2Python, Str2Doxygen, GetDateStr, GetTypesStringLatex
import os
def DestinationNr(strDest):
destNr = -1
if strDest.find('V') != -1:
destNr = 4
elif strDest.find('P'... | true | true |
1c1ebcaf5889259c1940c36ec8c6e8294c6125d4 | 3,482 | py | Python | test/functional/wallet_keypool.py | mrmikeo/MainNet-critical-fix | 4c1b63af4dad9850fb99ed85d8a015a9440f6654 | [
"MIT"
] | 2 | 2020-10-28T19:46:40.000Z | 2021-08-15T13:22:54.000Z | test/functional/wallet_keypool.py | mrmikeo/MainNet-critical-fix | 4c1b63af4dad9850fb99ed85d8a015a9440f6654 | [
"MIT"
] | null | null | null | test/functional/wallet_keypool.py | mrmikeo/MainNet-critical-fix | 4c1b63af4dad9850fb99ed85d8a015a9440f6654 | [
"MIT"
] | 2 | 2020-07-06T19:59:39.000Z | 2020-09-07T05:42:48.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2020 The Zelantus Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet keypool and interaction with wa... | 40.022989 | 119 | 0.666284 |
from test_framework.test_framework import ZelantusTestFramework
from test_framework.util import assert_equal, assert_raises_rpc_error, time
class KeyPoolTest(ZelantusTestFramework):
def set_test_params(self):
self.num_nodes = 1
def run_test(self):
nodes = self.nodes
addr_before_... | true | true |
1c1ebceafbc5ff018fcee541a6d4f3b7d32f509c | 1,647 | py | Python | appmgmt/views/main.py | ekivemark/BlueButtonDev | c751a5c52a83df6b97ef2c653a4492d959610c42 | [
"Apache-2.0"
] | 5 | 2016-03-02T23:25:39.000Z | 2020-10-29T07:28:42.000Z | appmgmt/views/main.py | HowardEdidin/BlueButtonFHIR_API | b8433055507bcc334f70bc864eacd379a04f69db | [
"Apache-2.0"
] | 13 | 2020-02-11T22:50:32.000Z | 2022-03-11T23:12:48.000Z | appmgmt/views/main.py | HowardEdidin/BlueButtonFHIR_API | b8433055507bcc334f70bc864eacd379a04f69db | [
"Apache-2.0"
] | 4 | 2016-02-02T19:17:24.000Z | 2020-10-10T16:10:31.000Z | """
bofhirdev.apps.appmgmt
FILE: views.py
Created: 10/28/15 5:20pm
"""
import random
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import (HttpResponse,
... | 28.396552 | 91 | 0.700061 |
import random
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import (HttpResponse,
JsonResponse,
HttpResponseRedirect)
from d... | true | true |
1c1ebd5084f9eef1528a5595d4d03fb5594b9543 | 551 | py | Python | homeassistant/components/cpuspeed/__init__.py | GoNzCiD/home-assistant-core | c7f465ff3b0caf6162625d6e0d7b8d280a2a3189 | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | homeassistant/components/cpuspeed/__init__.py | GoNzCiD/home-assistant-core | c7f465ff3b0caf6162625d6e0d7b8d280a2a3189 | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/cpuspeed/__init__.py | iMicknl/home-assistant-core | fc1899987aae9edf1f91100bf4f22766732bc835 | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """The CPU Speed integration."""
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from .const import PLATFORMS
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up from a config entry."""
hass.config_entries.async_setup_platf... | 32.411765 | 78 | 0.77314 | from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from .const import PLATFORMS
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
hass.config_entries.async_setup_platforms(entry, PLATFORMS)
return True
async def async_unload_entry(h... | true | true |
1c1ebe6d6b4a8bfc4997d58f91bb0170f175fcc5 | 1,076 | py | Python | Text.py | SmileyJoe/playground_python_bitwise | 5b6b6237612d77ed88fa8c41b258cbb1396c9f8a | [
"MIT"
] | null | null | null | Text.py | SmileyJoe/playground_python_bitwise | 5b6b6237612d77ed88fa8c41b258cbb1396c9f8a | [
"MIT"
] | null | null | null | Text.py | SmileyJoe/playground_python_bitwise | 5b6b6237612d77ed88fa8c41b258cbb1396c9f8a | [
"MIT"
] | null | null | null | from pprint import pprint
class Text:
LOWER_MIN = 0x0061
LOWER_MAX = 0x007A
HIGHER_MIN = 0x0041
HIGHER_MAX = 0x005A
DIFF = 0x0020
@staticmethod
def has_duplicate_char(text_input):
text = text_input.lower()
value = 0
for char in text:
number = 1 << (ord... | 25.619048 | 87 | 0.572491 | from pprint import pprint
class Text:
LOWER_MIN = 0x0061
LOWER_MAX = 0x007A
HIGHER_MIN = 0x0041
HIGHER_MAX = 0x005A
DIFF = 0x0020
@staticmethod
def has_duplicate_char(text_input):
text = text_input.lower()
value = 0
for char in text:
number = 1 << (ord... | true | true |
1c1ebea03b718f20254c22d47f95edb443739040 | 5,593 | py | Python | oldman/parsing/operation.py | oldm/OldMan | 5661e5a4d412c2e9e7cf59ef00f60ce5aef2ab6b | [
"BSD-3-Clause"
] | 6 | 2015-02-13T01:05:05.000Z | 2021-01-16T00:07:08.000Z | oldman/parsing/operation.py | oldm/OldMan | 5661e5a4d412c2e9e7cf59ef00f60ce5aef2ab6b | [
"BSD-3-Clause"
] | 7 | 2015-02-14T18:00:35.000Z | 2016-01-03T17:06:41.000Z | oldman/parsing/operation.py | oldm/OldMan | 5661e5a4d412c2e9e7cf59ef00f60ce5aef2ab6b | [
"BSD-3-Clause"
] | 3 | 2015-12-07T16:01:45.000Z | 2017-11-08T12:13:35.000Z | import logging
from rdflib import URIRef
from oldman.vocabulary import HYDRA_SUPPORTED_OPERATION, HYDRA_METHOD, HYDRA_EXCEPTS
from oldman.vocabulary import HYDRA_RETURNS, OLDM_SHORTNAME
from oldman.model.operation import Operation
def get_operation_function(operation_functions, class_iri, ancestry, method):
# T... | 39.387324 | 124 | 0.630788 | import logging
from rdflib import URIRef
from oldman.vocabulary import HYDRA_SUPPORTED_OPERATION, HYDRA_METHOD, HYDRA_EXCEPTS
from oldman.vocabulary import HYDRA_RETURNS, OLDM_SHORTNAME
from oldman.model.operation import Operation
def get_operation_function(operation_functions, class_iri, ancestry, method):
... | true | true |
1c1ebf7a02cbfa7e1a5133f8c7e3bfae7c65f7fb | 650 | py | Python | tests/test_ext_autodoc.py | hio/sphinx | cb0220de1a0d8acd00292b898d2ef03b588179b0 | [
"BSD-2-Clause"
] | 1 | 2021-11-06T17:09:04.000Z | 2021-11-06T17:09:04.000Z | tests/test_ext_autodoc.py | hio/sphinx | cb0220de1a0d8acd00292b898d2ef03b588179b0 | [
"BSD-2-Clause"
] | 1 | 2019-02-10T23:52:09.000Z | 2019-02-10T23:52:09.000Z | tests/test_ext_autodoc.py | hio/sphinx | cb0220de1a0d8acd00292b898d2ef03b588179b0 | [
"BSD-2-Clause"
] | 1 | 2021-11-06T17:08:54.000Z | 2021-11-06T17:08:54.000Z | # -*- coding: utf-8 -*-
"""
test_autodoc
~~~~~~~~~~~~
Test the autodoc extension.
:copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import pickle
import pytest
from sphinx import addnodes
@pytest.mark.sphinx('dummy', testroot='ext-autod... | 26 | 73 | 0.675385 |
import pickle
import pytest
from sphinx import addnodes
@pytest.mark.sphinx('dummy', testroot='ext-autodoc')
def test_autodoc(app, status, warning):
app.builder.build_all()
content = pickle.loads((app.doctreedir / 'contents.doctree').bytes())
assert isinstance(content[3], addnodes.desc)
assert cont... | true | true |
1c1ebff4fb54a96983091bfb49ba7a9ecd64ee97 | 24,088 | py | Python | cl/gen/SkylineParser.py | MarcDV1999/Skyline-Telegram-Bot | e517122715c81bbb8f21ac36df17aadb61360fb5 | [
"MIT"
] | null | null | null | cl/gen/SkylineParser.py | MarcDV1999/Skyline-Telegram-Bot | e517122715c81bbb8f21ac36df17aadb61360fb5 | [
"MIT"
] | null | null | null | cl/gen/SkylineParser.py | MarcDV1999/Skyline-Telegram-Bot | e517122715c81bbb8f21ac36df17aadb61360fb5 | [
"MIT"
] | null | null | null | # Generated from /Users/marcdomenech/Desktop/UPC/Computacio/LP/Skyline Telegram Bot/cl/Skyline.g4 by ANTLR 4.8
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
from typing import TextIO
else:
from typing.io import TextIO
def serializedATN():
with StringIO() a... | 33.595537 | 110 | 0.538442 |
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
from typing import TextIO
else:
from typing.io import TextIO
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\21")
buf.write("h\4\2\t\2\4\3\t\3\4\4\t\... | true | true |
1c1ec0481e01bde7b9dbbbfd9305650a48331edc | 9,689 | py | Python | geomloss/examples/optimal_transport/plot_interpolation_3D.py | tanglef/geomloss | 4e09e3bfd376d92f2bb7efdf0854a5b7c756eb0d | [
"MIT"
] | null | null | null | geomloss/examples/optimal_transport/plot_interpolation_3D.py | tanglef/geomloss | 4e09e3bfd376d92f2bb7efdf0854a5b7c756eb0d | [
"MIT"
] | null | null | null | geomloss/examples/optimal_transport/plot_interpolation_3D.py | tanglef/geomloss | 4e09e3bfd376d92f2bb7efdf0854a5b7c756eb0d | [
"MIT"
] | null | null | null | """Creating a fancy interpolation video between 3D meshes.
==============================================================
N.B.: I am currently very busy writing my PhD thesis. Comments will come soon!
"""
################################################################################
# Setup
# ---------------------... | 30.183801 | 118 | 0.56239 | true | true | |
1c1ec0551592989f1ae9d116edd2b826edf1374c | 1,105 | py | Python | src/cms/pages/admin_actions.py | UniversitaDellaCalabria/uniCMS | b0af4e1a767867f0a9b3c135a5c84587e713cb71 | [
"Apache-2.0"
] | 6 | 2021-01-26T17:22:53.000Z | 2022-02-15T10:09:03.000Z | src/cms/pages/admin_actions.py | UniversitaDellaCalabria/uniCMS | b0af4e1a767867f0a9b3c135a5c84587e713cb71 | [
"Apache-2.0"
] | 5 | 2020-12-24T14:29:23.000Z | 2021-08-10T10:32:18.000Z | src/cms/pages/admin_actions.py | UniversitaDellaCalabria/uniCMS | b0af4e1a767867f0a9b3c135a5c84587e713cb71 | [
"Apache-2.0"
] | 2 | 2020-12-24T14:13:39.000Z | 2020-12-30T16:48:52.000Z | from django.http import HttpResponseRedirect
from django.shortcuts import render
from cms.contexts.models import *
from cms.pages.models import *
from cms.templates.models import *
from . forms import PageTemplatesListForm
def update_template(self, request, queryset):
"""
update template to selected pages
... | 31.571429 | 73 | 0.619005 | from django.http import HttpResponseRedirect
from django.shortcuts import render
from cms.contexts.models import *
from cms.pages.models import *
from cms.templates.models import *
from . forms import PageTemplatesListForm
def update_template(self, request, queryset):
if 'update_template' in request.POST:
... | true | true |
1c1ec12c8de455bdf583ebde24db7c7ec2176546 | 1,741 | py | Python | bundles/timemachine/items.py | bborbe/bw | a89441855431f759b8466b1864c3679f86e522f5 | [
"BSD-2-Clause"
] | 1 | 2020-02-01T17:22:55.000Z | 2020-02-01T17:22:55.000Z | bundles/timemachine/items.py | bborbe/bw | a89441855431f759b8466b1864c3679f86e522f5 | [
"BSD-2-Clause"
] | null | null | null | bundles/timemachine/items.py | bborbe/bw | a89441855431f759b8466b1864c3679f86e522f5 | [
"BSD-2-Clause"
] | null | null | null | if node.os != 'ubuntu' and node.os != 'raspbian':
raise Exception('{} {} is not supported by this bundle'.format(node.os, node.os_version))
pkg_apt = {}
svc_systemd = {}
files = {}
directories = {}
pkg_apt['netatalk'] = {
'installed': node.metadata.get('timemachine', {}).get('enabled', False),
}
pkg_apt['ava... | 28.080645 | 93 | 0.545663 | if node.os != 'ubuntu' and node.os != 'raspbian':
raise Exception('{} {} is not supported by this bundle'.format(node.os, node.os_version))
pkg_apt = {}
svc_systemd = {}
files = {}
directories = {}
pkg_apt['netatalk'] = {
'installed': node.metadata.get('timemachine', {}).get('enabled', False),
}
pkg_apt['ava... | true | true |
1c1ec345ec0ad365fe58ca22763077a5aaa62619 | 3,253 | py | Python | nimare/meta/cbma/model.py | chrisfilo/NiMARE | d1854fc9e0cb4ae1f10cc4ffffa36cff0b3780ab | [
"MIT"
] | null | null | null | nimare/meta/cbma/model.py | chrisfilo/NiMARE | d1854fc9e0cb4ae1f10cc4ffffa36cff0b3780ab | [
"MIT"
] | null | null | null | nimare/meta/cbma/model.py | chrisfilo/NiMARE | d1854fc9e0cb4ae1f10cc4ffffa36cff0b3780ab | [
"MIT"
] | null | null | null | """
Model-based coordinate-based meta-analysis estimators
"""
from .base import CBMAEstimator
from ...due import due, Doi, BibTeX
@due.dcite(Doi('10.1198/jasa.2011.ap09735'),
description='Introduces the BHICP model.')
class BHICP(CBMAEstimator):
"""
Bayesian hierarchical cluster process model
... | 29.044643 | 80 | 0.585306 |
from .base import CBMAEstimator
from ...due import due, Doi, BibTeX
@due.dcite(Doi('10.1198/jasa.2011.ap09735'),
description='Introduces the BHICP model.')
class BHICP(CBMAEstimator):
def __init__(self, dataset):
self.dataset = dataset
def fit(self, sample):
pass
@due.dcite(BibT... | true | true |
1c1ec36d098ef0631bc03c6bce0c135d04c6d91a | 171 | py | Python | api/core/pagination.py | dima7a14/FamilyBudget-api | 871947b40c47a62198b9a5d6c524ee6d4fc93088 | [
"MIT"
] | null | null | null | api/core/pagination.py | dima7a14/FamilyBudget-api | 871947b40c47a62198b9a5d6c524ee6d4fc93088 | [
"MIT"
] | 1 | 2021-04-08T19:28:42.000Z | 2021-04-08T19:28:42.000Z | api/core/pagination.py | dima7a14/FamilyBudget-api | 871947b40c47a62198b9a5d6c524ee6d4fc93088 | [
"MIT"
] | null | null | null | from rest_framework.pagination import PageNumberPagination
class DefaultPagination(PageNumberPagination):
ordering = ['created_at', 'updated_at']
page_size = 50
| 24.428571 | 58 | 0.789474 | from rest_framework.pagination import PageNumberPagination
class DefaultPagination(PageNumberPagination):
ordering = ['created_at', 'updated_at']
page_size = 50
| true | true |
1c1ec3d811ec6d24106867af3031351b7a0a4086 | 39,425 | py | Python | venv/lib/python3.7/site-packages/PyInstaller/utils/hooks/__init__.py | alexzacher/BMI-Body-Mass-Index-Calculator-APP | f54473757992568b73b066d507059e1053357174 | [
"MIT"
] | 5 | 2020-08-24T23:29:58.000Z | 2022-02-07T19:58:07.000Z | venv/lib/python3.7/site-packages/PyInstaller/utils/hooks/__init__.py | alexzacher/BMI-Body-Mass-Index-Calculator-APP | f54473757992568b73b066d507059e1053357174 | [
"MIT"
] | 12 | 2020-02-15T04:04:55.000Z | 2022-02-18T20:29:49.000Z | venv/lib/python3.7/site-packages/PyInstaller/utils/hooks/__init__.py | alexzacher/BMI-Body-Mass-Index-Calculator-APP | f54473757992568b73b066d507059e1053357174 | [
"MIT"
] | 2 | 2020-08-24T23:30:06.000Z | 2021-12-23T18:23:38.000Z | #-----------------------------------------------------------------------------
# Copyright (c) 2005-2020, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt... | 38.765978 | 118 | 0.649562 |
import copy
import glob
import os
import pkg_resources
import pkgutil
import sys
import textwrap
from ...compat import base_prefix, exec_command_stdout, exec_python, \
is_darwin, is_py2, is_py3, is_venv, string_types, open_file, \
EXTENSION_SUFFIXES, ALL_SUFFIXES
from ... import HOMEPATH
from ... imp... | true | true |
1c1ec47816a68a5f1e6bd95909545d78e4328a73 | 3,704 | py | Python | bin/gftools-space-check.py | hyvyys/gftools | 85ef924f9307f290be08b15115805cc5e3287d33 | [
"Apache-2.0"
] | 150 | 2018-07-04T12:53:34.000Z | 2022-03-31T21:16:10.000Z | bin/gftools-space-check.py | hyvyys/gftools | 85ef924f9307f290be08b15115805cc5e3287d33 | [
"Apache-2.0"
] | 365 | 2018-06-28T19:35:22.000Z | 2022-03-30T17:07:56.000Z | bin/gftools-space-check.py | hyvyys/gftools | 85ef924f9307f290be08b15115805cc5e3287d33 | [
"Apache-2.0"
] | 53 | 2018-07-20T01:47:44.000Z | 2022-01-31T16:43:25.000Z | #!/usr/bin/env python3
#
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 28.713178 | 78 | 0.698704 |
from __future__ import print_function
import contextlib
import os
from fontTools import ttLib
from gftools.util import google_fonts as fonts
from absl import app
def _LoadGlyf(font, char, name, problems):
if 'glyf' not in font:
problems.add('NO_GLYF_TABLE')
return (None, None)
cmap = fon... | true | true |
1c1ec5b0829e19d7ccea440be96a39cfc3da17a4 | 5,308 | py | Python | installer/bkt_install/config.py | pyro-team/bkt-toolbox | bbccba142a81ca0a46056f2bcda75899979158a5 | [
"MIT"
] | 12 | 2019-05-31T02:57:26.000Z | 2022-03-26T09:40:50.000Z | installer/bkt_install/config.py | mrflory/bkt-toolbox | bbccba142a81ca0a46056f2bcda75899979158a5 | [
"MIT"
] | 27 | 2021-11-27T16:33:19.000Z | 2022-03-27T17:47:26.000Z | installer/bkt_install/config.py | pyro-team/bkt-toolbox | bbccba142a81ca0a46056f2bcda75899979158a5 | [
"MIT"
] | 3 | 2019-06-12T10:59:20.000Z | 2020-04-21T15:13:50.000Z | # -*- coding: utf-8 -*-
'''
Created on 25.02.2019
@author: fstallmann
'''
from __future__ import absolute_import, print_function
import os.path
from . import helper
from .globals import INSTALL_BASE
class Configurator(object):
@staticmethod
def get_config():
config_filename = os.path.join(INSTALL_... | 35.152318 | 126 | 0.610023 |
from __future__ import absolute_import, print_function
import os.path
from . import helper
from .globals import INSTALL_BASE
class Configurator(object):
@staticmethod
def get_config():
config_filename = os.path.join(INSTALL_BASE, "config.txt")
if not os.path.exists(config_filename):
... | true | true |
1c1ec67b0cdd9e4b1888776888ee3e42661501f2 | 3,010 | py | Python | aimay/core.py | ghsable/aimay | f154744372b3699f24a43502674e58e783b2284a | [
"MIT"
] | 1 | 2021-02-25T03:45:02.000Z | 2021-02-25T03:45:02.000Z | aimay/core.py | ghsable/aimay | f154744372b3699f24a43502674e58e783b2284a | [
"MIT"
] | 31 | 2020-09-02T04:29:03.000Z | 2022-03-31T20:09:56.000Z | aimay/core.py | ghsable/aimay | f154744372b3699f24a43502674e58e783b2284a | [
"MIT"
] | 3 | 2020-09-02T04:28:17.000Z | 2020-09-22T05:47:56.000Z | # -*- coding: utf-8 -*-
from . import helpers
def get_reply(push_type, push_text):
"""Get reply information.
:param push_type: push message type
:type push_type: str
:param push_text: push message text
:type push_text: str
:returns: reply_type, reply_text, reply_package, reply_sticker
:rty... | 49.344262 | 148 | 0.60598 |
from . import helpers
def get_reply(push_type, push_text):
reply_type, reply_text, reply_package, reply_sticker = None, None, None, None
if (push_type == 'text'):
if ('おうむ' in push_text) or ('オウム' in push_text) or ('鸚鵡' in push_text) or ('🦜' in push_text):
reply_type = 'text'
... | true | true |
1c1ec6cecb9d19c23850169d6402826de2760ae8 | 3,573 | py | Python | Katari/sip/utils/__init__.py | KalbiProject/Katari | 9b2b8968fc6952fbcc1170e55bd35dcec3386cfd | [
"BSD-3-Clause"
] | 13 | 2020-11-16T12:26:09.000Z | 2022-02-16T04:02:22.000Z | Katari/sip/utils/__init__.py | hyperioxx/Katari | 9b2b8968fc6952fbcc1170e55bd35dcec3386cfd | [
"BSD-3-Clause"
] | 10 | 2019-04-09T15:05:24.000Z | 2019-12-11T09:51:33.000Z | Katari/sip/utils/__init__.py | hyperioxx/Katari | 9b2b8968fc6952fbcc1170e55bd35dcec3386cfd | [
"BSD-3-Clause"
] | 4 | 2019-04-15T07:37:09.000Z | 2020-06-09T06:42:46.000Z | """
Utils module containing all sip header classes
"""
import re
import logging
from collections import OrderedDict
from Katari.errors import *
class Message:
"""
Base message
"""
def __init__(self, message):
self.raw_message = message
self._data = OrderedDict()
self.log = log... | 26.272059 | 78 | 0.471313 | import re
import logging
from collections import OrderedDict
from Katari.errors import *
class Message:
def __init__(self, message):
self.raw_message = message
self._data = OrderedDict()
self.log = logging.getLogger('Katari')
if message:
self.method_line, self.headers ... | true | true |
1c1ec76d8935953332426a66f8b9c6cd50a6e604 | 2,156 | py | Python | deafwave/wallet/settings/user_settings.py | SparXalt/deafwave-blockchain | 579eac55d55285f750c622bf66a1aa30ed6d949d | [
"Apache-2.0"
] | null | null | null | deafwave/wallet/settings/user_settings.py | SparXalt/deafwave-blockchain | 579eac55d55285f750c622bf66a1aa30ed6d949d | [
"Apache-2.0"
] | null | null | null | deafwave/wallet/settings/user_settings.py | SparXalt/deafwave-blockchain | 579eac55d55285f750c622bf66a1aa30ed6d949d | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict
from deafwave.wallet.key_val_store import KeyValStore
from deafwave.wallet.settings.default_settings import default_settings
from deafwave.wallet.settings.settings_objects import BackupInitialized
class UserSettings:
settings: Dict[str, Any]
basic_store: KeyValStore
@staticm... | 28.746667 | 79 | 0.632653 | from typing import Any, Dict
from deafwave.wallet.key_val_store import KeyValStore
from deafwave.wallet.settings.default_settings import default_settings
from deafwave.wallet.settings.settings_objects import BackupInitialized
class UserSettings:
settings: Dict[str, Any]
basic_store: KeyValStore
@staticm... | true | true |
1c1ec7c26123accc34439d0bd78d702b57790908 | 360 | py | Python | yc111/227.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | yc111/227.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | yc111/227.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | A = list(map(int, input().split()))
d = {}
for a in A:
d.setdefault(a, 0)
d[a] += 1
if len(d) == 2 and sorted(d.values()) == [2, 3]:
print('FULL HOUSE')
elif 3 in d.values():
print('THREE CARD')
elif len(d) == 3 and sorted(d.values()) == [1, 2, 2]:
print('TWO PAIR')
elif 2 in d.values():
print... | 20 | 53 | 0.536111 | A = list(map(int, input().split()))
d = {}
for a in A:
d.setdefault(a, 0)
d[a] += 1
if len(d) == 2 and sorted(d.values()) == [2, 3]:
print('FULL HOUSE')
elif 3 in d.values():
print('THREE CARD')
elif len(d) == 3 and sorted(d.values()) == [1, 2, 2]:
print('TWO PAIR')
elif 2 in d.values():
print... | true | true |
1c1ec855743c1dd3d07b7bcc783a625c62258c97 | 655 | py | Python | Python Fundamentals/Data Types and Variables/Exercise/Task10.py | DonikaChervenkova/SoftUni | bff579c037ec48f39ed193b34bc3502a32e90732 | [
"MIT"
] | null | null | null | Python Fundamentals/Data Types and Variables/Exercise/Task10.py | DonikaChervenkova/SoftUni | bff579c037ec48f39ed193b34bc3502a32e90732 | [
"MIT"
] | null | null | null | Python Fundamentals/Data Types and Variables/Exercise/Task10.py | DonikaChervenkova/SoftUni | bff579c037ec48f39ed193b34bc3502a32e90732 | [
"MIT"
] | 1 | 2021-12-04T12:30:57.000Z | 2021-12-04T12:30:57.000Z | count_lost_fights = int(input())
price_helmet = float(input())
price_sword = float(input())
price_shield = float(input())
price_armor = float(input())
total_expenses = 0
count_breaks_of_shield = 0
for lost_fight in range(1, count_lost_fights + 1):
if lost_fight % 2 == 0:
total_expenses += price_helmet
... | 25.192308 | 57 | 0.650382 | count_lost_fights = int(input())
price_helmet = float(input())
price_sword = float(input())
price_shield = float(input())
price_armor = float(input())
total_expenses = 0
count_breaks_of_shield = 0
for lost_fight in range(1, count_lost_fights + 1):
if lost_fight % 2 == 0:
total_expenses += price_helmet
... | true | true |
1c1ec8b6b8c443e6e7a3a91a0e6ba78caa804c17 | 70,866 | py | Python | dogepartylib/lib/blocks.py | pataegrillo/dogeparty-lib | 68be9a828ec31e21fc63fbf009157f1587a40db2 | [
"MIT"
] | null | null | null | dogepartylib/lib/blocks.py | pataegrillo/dogeparty-lib | 68be9a828ec31e21fc63fbf009157f1587a40db2 | [
"MIT"
] | 2 | 2022-02-09T18:39:05.000Z | 2022-02-25T16:38:00.000Z | dogepartylib/lib/blocks.py | pataegrillo/dogeparty-lib | 68be9a828ec31e21fc63fbf009157f1587a40db2 | [
"MIT"
] | 1 | 2022-03-22T13:42:17.000Z | 2022-03-22T13:42:17.000Z | """
Initialise database.
Sieve blockchain for Dogeparty transactions, and add them to the database.
"""
import os
import time
import binascii
import struct
import decimal
D = decimal.Decimal
import logging
logger = logging.getLogger(__name__)
import collections
import platform
import apsw
import csv
import copy
impor... | 45.022872 | 198 | 0.587842 |
import os
import time
import binascii
import struct
import decimal
D = decimal.Decimal
import logging
logger = logging.getLogger(__name__)
import collections
import platform
import apsw
import csv
import copy
import http
import bitcoin as bitcoinlib
from bitcoin.core.script import CScriptInvalidError
from dogepartyl... | true | true |
1c1ec8fc4dece49d5d8a9ce1b4aa1e737787006c | 351 | py | Python | Cartwheel/lib/Python26/Lib/site-packages/OpenGL/GL/SGIX/async.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | Cartwheel/lib/Python26/Lib/site-packages/OpenGL/GL/SGIX/async.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | Cartwheel/lib/Python26/Lib/site-packages/OpenGL/GL/SGIX/async.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | '''OpenGL extension SGIX.async
This module customises the behaviour of the
OpenGL.raw.GL.SGIX.async to provide a more
Python-friendly API
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions, wrapper
from OpenGL.GL import glget
import ctypes
from OpenGL.raw.GL.SGIX.async import ... | 29.25 | 56 | 0.797721 | '''OpenGL extension SGIX.async
This module customises the behaviour of the
OpenGL.raw.GL.SGIX.async to provide a more
Python-friendly API
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions, wrapper
from OpenGL.GL import glget
import ctypes
from OpenGL.raw.GL.SGIX.async import ... | false | true |
1c1ec90a42fd7323e60a0850dd33e814d4e14ea7 | 650 | py | Python | heat/core/__init__.py | sebimarkgraf/heat | 9638e384f52c9bade75590963b9d57e080692da4 | [
"MIT"
] | null | null | null | heat/core/__init__.py | sebimarkgraf/heat | 9638e384f52c9bade75590963b9d57e080692da4 | [
"MIT"
] | null | null | null | heat/core/__init__.py | sebimarkgraf/heat | 9638e384f52c9bade75590963b9d57e080692da4 | [
"MIT"
] | null | null | null | from .arithmetics import *
from .base import *
from .communication import *
from .constants import *
from .devices import *
from .exponential import *
from .factories import *
from .indexing import *
from .io import *
from .logical import *
from .manipulations import *
from .memory import *
from ._operations import *
f... | 24.074074 | 32 | 0.763077 | from .arithmetics import *
from .base import *
from .communication import *
from .constants import *
from .devices import *
from .exponential import *
from .factories import *
from .indexing import *
from .io import *
from .logical import *
from .manipulations import *
from .memory import *
from ._operations import *
f... | true | true |
1c1ec9122751b9c807b379f707363194beb41053 | 2,467 | py | Python | robust_sleep_net/trainers/regularization.py | Dreem-Organization/RobustSleepNet | c8ff3f6f857299eb2bf2e9400483084d5ecd4106 | [
"MIT"
] | 16 | 2021-04-06T14:04:45.000Z | 2022-03-11T14:37:08.000Z | robust_sleep_net/trainers/regularization.py | Dreem-Organization/RobustSleepNet | c8ff3f6f857299eb2bf2e9400483084d5ecd4106 | [
"MIT"
] | null | null | null | robust_sleep_net/trainers/regularization.py | Dreem-Organization/RobustSleepNet | c8ff3f6f857299eb2bf2e9400483084d5ecd4106 | [
"MIT"
] | 4 | 2021-06-10T06:48:33.000Z | 2022-03-26T22:29:07.000Z | # -*- coding: utf-8 -*-
# Source code from https://github.com/dizam92/pyTorchReg/
__author__ = "maoss2"
class _Regularizer(object):
"""
Parent class of Regularizers
"""
def __init__(self, model):
super(_Regularizer, self).__init__()
self.model = model
def regularized_param(self, ... | 32.460526 | 100 | 0.688285 |
__author__ = "maoss2"
class _Regularizer(object):
def __init__(self, model):
super(_Regularizer, self).__init__()
self.model = model
def regularized_param(self, param_weights, reg_loss_function):
raise NotImplementedError
def regularized_all_param(self, reg_loss_function):
... | true | true |
1c1ec9d9351320db10e1fc87bf313f2a82772251 | 2,132 | py | Python | codes/shapes.py | RafalSkolasinski/simulation-codes-arxiv-1806.01815 | fc5c27c6c625cc7f45cf5d7627eaafa3d3df4b9e | [
"BSD-2-Clause"
] | null | null | null | codes/shapes.py | RafalSkolasinski/simulation-codes-arxiv-1806.01815 | fc5c27c6c625cc7f45cf5d7627eaafa3d3df4b9e | [
"BSD-2-Clause"
] | null | null | null | codes/shapes.py | RafalSkolasinski/simulation-codes-arxiv-1806.01815 | fc5c27c6c625cc7f45cf5d7627eaafa3d3df4b9e | [
"BSD-2-Clause"
] | null | null | null | # Collection of shape functions used in this projects
import numpy as np
from functools import lru_cache
@lru_cache()
def define_shape(name, R):
"""Define shape of a given type and specified radius.
Parameters
----------
shape : string
Name of the chosen shape. Options are 'hexagon', 'circl... | 25.082353 | 79 | 0.571764 |
import numpy as np
from functools import lru_cache
@lru_cache()
def define_shape(name, R):
if name not in ['hexagon', 'circle', 'square', 'rectangular']:
raise ValueError('Wrong type of shape: "{}".'.format(name))
if name == 'rectangular' and not isinstance(R, tuple):
raise ValueError('If ... | true | true |
1c1eca26a00211d753f9aa97a6563271901a93b7 | 2,436 | py | Python | tests/dashboard/widgets/test_reg_pred_vs_actual_widget.py | Tapot/evidently | ab9b91425d622566b663565508dd1c43e741f515 | [
"Apache-2.0"
] | null | null | null | tests/dashboard/widgets/test_reg_pred_vs_actual_widget.py | Tapot/evidently | ab9b91425d622566b663565508dd1c43e741f515 | [
"Apache-2.0"
] | null | null | null | tests/dashboard/widgets/test_reg_pred_vs_actual_widget.py | Tapot/evidently | ab9b91425d622566b663565508dd1c43e741f515 | [
"Apache-2.0"
] | null | null | null | from typing import Optional
import pandas as pd
import pytest
from evidently.analyzers.regression_performance_analyzer import RegressionPerformanceAnalyzer
from evidently.model.widget import BaseWidgetInfo
from evidently.options import OptionsProvider
from evidently.pipeline.column_mapping import ColumnMapping
from ... | 32.918919 | 101 | 0.692939 | from typing import Optional
import pandas as pd
import pytest
from evidently.analyzers.regression_performance_analyzer import RegressionPerformanceAnalyzer
from evidently.model.widget import BaseWidgetInfo
from evidently.options import OptionsProvider
from evidently.pipeline.column_mapping import ColumnMapping
from ... | true | true |
1c1ecafd2b8796de06f7482686d8ad68d007a08d | 874 | py | Python | zvt/stats/plots.py | doncat99/zvt | 831183bdf7a6d0fc3acd3ea51984df590078eec6 | [
"MIT"
] | 10 | 2020-08-08T04:43:00.000Z | 2021-07-23T05:38:11.000Z | zvt/stats/plots.py | doncat99/FinanceAnalysis | 689aed45bab9e691566b308d2778170a0b3950ec | [
"MIT"
] | 1 | 2021-08-14T12:19:18.000Z | 2021-09-30T06:44:04.000Z | zvt/stats/plots.py | doncat99/FinanceAnalysis | 689aed45bab9e691566b308d2778170a0b3950ec | [
"MIT"
] | 4 | 2020-10-30T07:33:16.000Z | 2021-09-09T09:25:27.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# QuantStats: Portfolio analytics for quants
# https://github.com/ranaroussi/quantstats
#
# Copyright 2019 Ran Aroussi
#
# 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... | 31.214286 | 74 | 0.75286 |
try:
from pandas.plotting import register_matplotlib_converters as _rmc
_rmc()
except ImportError:
pass
from zvt.stats._plotting.wrappers import *
| true | true |
1c1ecd3d01e31215fc7649a7168d77de24fdfbd1 | 29,456 | py | Python | astropy/io/fits/util.py | PriyankaH21/astropy | 159fb9637ce4acdc60329d20517ed3dc7ba79581 | [
"BSD-3-Clause"
] | 1 | 2022-03-02T17:07:20.000Z | 2022-03-02T17:07:20.000Z | astropy/io/fits/util.py | PriyankaH21/astropy | 159fb9637ce4acdc60329d20517ed3dc7ba79581 | [
"BSD-3-Clause"
] | 1 | 2018-11-14T14:18:55.000Z | 2020-01-21T10:36:05.000Z | astropy/io/fits/util.py | PriyankaH21/astropy | 159fb9637ce4acdc60329d20517ed3dc7ba79581 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import gzip
import itertools
import io
import mmap
import operator
import os
import platform
import signal
import sys
import tempfile
import textwrap
import threading
import warnings
import weakref
from contextlib import contextmanager, suppress
from ...u... | 31.673118 | 86 | 0.618244 |
import gzip
import itertools
import io
import mmap
import operator
import os
import platform
import signal
import sys
import tempfile
import textwrap
import threading
import warnings
import weakref
from contextlib import contextmanager, suppress
from ...utils import data
from distutils.version import LooseVersion
... | true | true |
1c1ed0b44453c2f4f41f95ba4fc018a2288a45b1 | 9,481 | py | Python | sdk/python/pulumi_azure_nextgen/storsimple/v20170601/volume.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/storsimple/v20170601/volume.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/storsimple/v20170601/volume.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 41.04329 | 150 | 0.631579 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = ['Volume']
class Volume(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.Resou... | true | true |
1c1ed0c7f22485b8821bd557f4ec4acf9720ac84 | 19,769 | py | Python | neurokit2/signal/signal_timefrequency.py | aristotelisxs/NeuroKit | 61c8c9b26ac7bc8ac5b666ce6cb1dfe59b1c146b | [
"MIT"
] | 1 | 2020-12-31T17:48:11.000Z | 2020-12-31T17:48:11.000Z | neurokit2/signal/signal_timefrequency.py | aristotelisxs/NeuroKit | 61c8c9b26ac7bc8ac5b666ce6cb1dfe59b1c146b | [
"MIT"
] | null | null | null | neurokit2/signal/signal_timefrequency.py | aristotelisxs/NeuroKit | 61c8c9b26ac7bc8ac5b666ce6cb1dfe59b1c146b | [
"MIT"
] | 1 | 2020-12-20T17:24:25.000Z | 2020-12-20T17:24:25.000Z | # -*- coding: utf-8 -*-
import numpy as np
import scipy.signal
import matplotlib.pyplot as plt
from ..signal.signal_detrend import signal_detrend
def signal_timefrequency(signal, sampling_rate=1000, min_frequency=0.04, max_frequency=None, method="stft", window=None, window_type='hann', mode='psd', nfreqbin=None, ove... | 40.760825 | 217 | 0.598007 |
import numpy as np
import scipy.signal
import matplotlib.pyplot as plt
from ..signal.signal_detrend import signal_detrend
def signal_timefrequency(signal, sampling_rate=1000, min_frequency=0.04, max_frequency=None, method="stft", window=None, window_type='hann', mode='psd', nfreqbin=None, overlap=None, analytical_s... | true | true |
1c1ed1519ab5a2b7ed83c26a4f33df7d63403f13 | 101,803 | py | Python | lingvo/core/attention_test.py | RunzheYang/lingvo | 1291e29812f9ee9836f9cacbb05db9ec6b095234 | [
"Apache-2.0"
] | null | null | null | lingvo/core/attention_test.py | RunzheYang/lingvo | 1291e29812f9ee9836f9cacbb05db9ec6b095234 | [
"Apache-2.0"
] | null | null | null | lingvo/core/attention_test.py | RunzheYang/lingvo | 1291e29812f9ee9836f9cacbb05db9ec6b095234 | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# 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 ... | 42.882477 | 85 | 0.634333 |
import math
from absl.testing import parameterized
import lingvo.compat as tf
from lingvo.core import attention
from lingvo.core import layers
from lingvo.core import py_utils
from lingvo.core import quant_utils
from lingvo.core import test_utils
import numpy as np
class AttentionTest(test_utils.TestC... | true | true |
1c1ed2478adf2a38a689e1b032d7e65a00e97e35 | 313 | py | Python | user_panel/python/test.py | Gaurang1811/Stock_Market | 941413d0943b6f8bbbc8b761c9681283be191890 | [
"MIT"
] | null | null | null | user_panel/python/test.py | Gaurang1811/Stock_Market | 941413d0943b6f8bbbc8b761c9681283be191890 | [
"MIT"
] | 1 | 2020-01-24T01:42:08.000Z | 2020-01-24T01:42:08.000Z | user_panel/python/test.py | Gaurang1811/Stock_Market | 941413d0943b6f8bbbc8b761c9681283be191890 | [
"MIT"
] | null | null | null |
import csv
with open("datasets/500290.csv", "r") as f:
data = list(csv.reader(f))
print(data[0])
print(len(data))
i = 15;
with open("datasets/500290.csv", "w") as f:
writer = csv.writer(f)
writer.writerow(data[0])
while i < len(data):
writer.writerow(data[i])
i = i + 1;
| 20.866667 | 43 | 0.57508 |
import csv
with open("datasets/500290.csv", "r") as f:
data = list(csv.reader(f))
print(data[0])
print(len(data))
i = 15;
with open("datasets/500290.csv", "w") as f:
writer = csv.writer(f)
writer.writerow(data[0])
while i < len(data):
writer.writerow(data[i])
i = i + 1;
| true | true |
1c1ed2f4c669c6438af348e50eb0c56aa33077ee | 980 | py | Python | command_history.py | ThomasGerstenberg/sublime3-serial-monitor | 6e25172aca9ad755b8ec2f7e3efc5664ce35ed7e | [
"BSD-3-Clause"
] | 10 | 2016-02-12T08:44:49.000Z | 2018-08-29T21:34:49.000Z | command_history.py | ThomasGerstenberg/sublime3-serial-monitor | 6e25172aca9ad755b8ec2f7e3efc5664ce35ed7e | [
"BSD-3-Clause"
] | 30 | 2015-08-31T18:56:31.000Z | 2018-12-04T02:55:02.000Z | command_history.py | ThomasGerstenberg/sublime3-serial-monitor | 6e25172aca9ad755b8ec2f7e3efc5664ce35ed7e | [
"BSD-3-Clause"
] | 6 | 2016-01-21T03:40:28.000Z | 2021-12-10T08:13:57.000Z | class CommandHistory(object):
def __init__(self):
self._entries = [""]
self.index = 0
def add_entry(self, entry):
if not entry:
return
if entry in self._entries:
self._entries.remove(entry)
self._entries.insert(1, entry)
if len(... | 25.789474 | 68 | 0.542857 | class CommandHistory(object):
def __init__(self):
self._entries = [""]
self.index = 0
def add_entry(self, entry):
if not entry:
return
if entry in self._entries:
self._entries.remove(entry)
self._entries.insert(1, entry)
if len(... | true | true |
1c1ed34fc7641b18161e069c4229be7c7b7a2afc | 18,891 | py | Python | rpython/translator/backendopt/test/test_inline.py | jptomo/pypy-lang-scheme | 55edb2cec69d78f86793282a4566fcbc1ef9fcac | [
"MIT"
] | 34 | 2015-07-09T04:53:27.000Z | 2021-07-19T05:22:27.000Z | rpython/translator/backendopt/test/test_inline.py | jptomo/pypy-lang-scheme | 55edb2cec69d78f86793282a4566fcbc1ef9fcac | [
"MIT"
] | 6 | 2015-05-30T17:20:45.000Z | 2017-06-12T14:29:23.000Z | rpython/translator/backendopt/test/test_inline.py | jptomo/pypy-lang-scheme | 55edb2cec69d78f86793282a4566fcbc1ef9fcac | [
"MIT"
] | 11 | 2015-09-07T14:26:08.000Z | 2020-04-10T07:20:41.000Z | # XXX clean up these tests to use more uniform helpers
import py
from rpython.flowspace.model import Variable, Constant, checkgraph
from rpython.translator.backendopt import canraise
from rpython.translator.backendopt.inline import (simple_inline_function,
CannotInline, auto_inlining, Inliner, collect_called_graphs... | 30.274038 | 90 | 0.500397 |
import py
from rpython.flowspace.model import Variable, Constant, checkgraph
from rpython.translator.backendopt import canraise
from rpython.translator.backendopt.inline import (simple_inline_function,
CannotInline, auto_inlining, Inliner, collect_called_graphs,
measure_median_execution_cost, instrument_inline... | true | true |
1c1ed39fc443725ec3632de82f30a8738ed3d727 | 3,457 | py | Python | COMSC-020/Chapter 12. Dictionaries/cities.py | H2u-Hwng/EVC | c650fe7356a333011514cf9025dfd97bf71b1de3 | [
"MIT"
] | null | null | null | COMSC-020/Chapter 12. Dictionaries/cities.py | H2u-Hwng/EVC | c650fe7356a333011514cf9025dfd97bf71b1de3 | [
"MIT"
] | null | null | null | COMSC-020/Chapter 12. Dictionaries/cities.py | H2u-Hwng/EVC | c650fe7356a333011514cf9025dfd97bf71b1de3 | [
"MIT"
] | null | null | null | # Huu Hung Nguyen
# 12/02/2021
# Nguyen_HuuHung_cities.py
# The program opens a file named cities.txt.
# It creates a dictionary where the key is the city name and the value is
# a list that contains the country and population.
# It prints the total number of cities and the average population.
# It then prints the city... | 28.570248 | 103 | 0.61643 |
INPUT_FILE = 'cities.txt'
def capitalize_city(city):
formated_city = ''
for word in city.strip().split():
formated_city += word.capitalize() + ' '
formated_city = formated_city.strip()
return formated_city
def get_mean(data_list):
n ... | true | true |
1c1ed4866cfd1fdd4adc9b86bf3ec988bc98f74a | 3,135 | py | Python | experiment_control.py | scottamoore/auction | e278a5e47591b788d7746f2b34c122bd3e426206 | [
"MIT"
] | null | null | null | experiment_control.py | scottamoore/auction | e278a5e47591b788d7746f2b34c122bd3e426206 | [
"MIT"
] | null | null | null | experiment_control.py | scottamoore/auction | e278a5e47591b788d7746f2b34c122bd3e426206 | [
"MIT"
] | null | null | null | """
Description.
Example
-------
asdf
Attributes
----------
asdf
Todo
----
asdf
"""
from typing import List # , TextIO, Optional, Set, Union, Dict, Tuple
import market as mkt
import etzion as etz
import utilities as util
def control_experiment(assump):
num_of_simulations: int = 0
num_of_simulation_sets: ... | 44.785714 | 108 | 0.527911 | from typing import List
import market as mkt
import etzion as etz
import utilities as util
def control_experiment(assump):
num_of_simulations: int = 0
num_of_simulation_sets: int = 1
print("Beginning to run the simulation.")
for env in util.get_environment_settings():
print(f"Environment set... | true | true |
1c1ed491c2bd57f511529186b5bb1119de669690 | 2,072 | py | Python | lcof/67-ba-zi-fu-chuan-zhuan-huan-cheng-zheng-shu-lcof.py | yuenliou/leetcode | e8a1c6cae6547cbcb6e8494be6df685f3e7c837c | [
"MIT"
] | null | null | null | lcof/67-ba-zi-fu-chuan-zhuan-huan-cheng-zheng-shu-lcof.py | yuenliou/leetcode | e8a1c6cae6547cbcb6e8494be6df685f3e7c837c | [
"MIT"
] | null | null | null | lcof/67-ba-zi-fu-chuan-zhuan-huan-cheng-zheng-shu-lcof.py | yuenliou/leetcode | e8a1c6cae6547cbcb6e8494be6df685f3e7c837c | [
"MIT"
] | null | null | null | #!/usr/local/bin/python3.7
# -*- coding: utf-8 -*-
class Solution:
def strToInt(self, str: str) -> int:
"""常规思路:各种场景"""
s = str.strip()
if len(s) == 0:
return 0
first = s[0]
flag = 1
if first == '+':
s = s[1:]
if first == '-':
... | 19.009174 | 103 | 0.570463 |
class Solution:
def strToInt(self, str: str) -> int:
s = str.strip()
if len(s) == 0:
return 0
first = s[0]
flag = 1
if first == '+':
s = s[1:]
if first == '-':
flag = -1
s = s[1:]
num = 0
for c in ... | true | true |
1c1ed4a8d6d588a595987e1d4fe1aca7eb9e4921 | 1,306 | py | Python | Files/Ch06/cloud_text_recognition final.py | mahdinobar/Image-Recognition-inLearning | 940d5b88f70e65021ea63a4cc71fff9ce231f1a2 | [
"MIT"
] | null | null | null | Files/Ch06/cloud_text_recognition final.py | mahdinobar/Image-Recognition-inLearning | 940d5b88f70e65021ea63a4cc71fff9ce231f1a2 | [
"MIT"
] | 7 | 2019-12-16T22:15:20.000Z | 2022-02-10T00:35:12.000Z | Ex_Files_Deep_Learning_Image_Recog_Upd/Exercise Files/Ch06/cloud_text_recognition.py | gilson27/learning_experiments | c329b1e0de8dd50afc70fb257540b569927156d1 | [
"MIT"
] | null | null | null | from base64 import b64encode
import googleapiclient.discovery
from oauth2client.client import GoogleCredentials
# Change this values to match your project
IMAGE_FILE = "text.png"
CREDENTIALS_FILE = "credentials.json"
# Connect to the Google Cloud-ML Service
credentials = GoogleCredentials.from_stream(CREDENTIALS_FIL... | 27.787234 | 82 | 0.734303 | from base64 import b64encode
import googleapiclient.discovery
from oauth2client.client import GoogleCredentials
IMAGE_FILE = "text.png"
CREDENTIALS_FILE = "credentials.json"
credentials = GoogleCredentials.from_stream(CREDENTIALS_FILE)
service = googleapiclient.discovery.build('vision', 'v1', credentials=credentia... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.