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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2fb9e585142cd6b3ce74512705e983aa22ee83 | 1,608 | py | Python | amber/urls.py | Taywee/amberherbert.com | 6bf384d7cdf18dc613252fe4dde38545150eabbc | [
"MIT"
] | null | null | null | amber/urls.py | Taywee/amberherbert.com | 6bf384d7cdf18dc613252fe4dde38545150eabbc | [
"MIT"
] | 2 | 2017-10-15T20:36:59.000Z | 2017-10-17T05:27:49.000Z | amber/urls.py | Taywee/amberherbert.com | 6bf384d7cdf18dc613252fe4dde38545150eabbc | [
"MIT"
] | null | null | null | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from wagtail.admin import urls as wagtailadmin_urls
from wagtail.core import urls as wagtail_urls
from wagtail.documents import urls as wagtaildocs_urls
... | 31.529412 | 80 | 0.731343 | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from wagtail.admin import urls as wagtailadmin_urls
from wagtail.core import urls as wagtail_urls
from wagtail.documents import urls as wagtaildocs_urls
... | true | true |
1c2fb9fa00e7283d38dd9f6522c0eb79545438ef | 2,145 | py | Python | sympy/polys/tests/test_rationaltools.py | minrk/sympy | 1cc6e3837b8ed20ba52ea97298f31aa08b43c508 | [
"BSD-3-Clause"
] | 2 | 2015-11-13T16:40:57.000Z | 2017-09-15T15:37:19.000Z | openrave/sympy/polys/tests/test_rationaltools.py | jdsika/holy | a2ac55fa1751a3a8038cf61d29b95005f36d6264 | [
"MIT"
] | 1 | 2016-06-13T01:29:51.000Z | 2016-06-14T00:38:27.000Z | openrave/sympy/polys/tests/test_rationaltools.py | jdsika/holy | a2ac55fa1751a3a8038cf61d29b95005f36d6264 | [
"MIT"
] | null | null | null | """Tests for tools for manipulation of rational expressions. """
from sympy.polys.rationaltools import together
from sympy import S, symbols, Rational, sin, exp, Eq, Integral, Mul
from sympy.abc import x, y, z
A, B = symbols('A,B', commutative=False)
def test_together():
assert together(0) == 0
assert toget... | 39 | 90 | 0.486247 |
from sympy.polys.rationaltools import together
from sympy import S, symbols, Rational, sin, exp, Eq, Integral, Mul
from sympy.abc import x, y, z
A, B = symbols('A,B', commutative=False)
def test_together():
assert together(0) == 0
assert together(1) == 1
assert together(x*y*z) == x*y*z
assert toget... | true | true |
1c2fba2b5b481ced053f949679d016b98fc94c72 | 42,298 | py | Python | tools/linter_lib/custom_check.py | dmryabov/zulip | fd2a63b049277f3cc7267a4a5bdbb485c4933719 | [
"Apache-2.0"
] | null | null | null | tools/linter_lib/custom_check.py | dmryabov/zulip | fd2a63b049277f3cc7267a4a5bdbb485c4933719 | [
"Apache-2.0"
] | null | null | null | tools/linter_lib/custom_check.py | dmryabov/zulip | fd2a63b049277f3cc7267a4a5bdbb485c4933719 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
from zulint.custom_rules import RuleList
from typing import cast, Any, Dict, List, Tuple
Rule = List[Dict[str, Any]]
# Rule help:
# By default, a rule applies to all files within the extension for which it is specif... | 50.717026 | 222 | 0.571327 |
from __future__ import print_function
from __future__ import absolute_import
from zulint.custom_rules import RuleList
from typing import cast, Any, Dict, List, Tuple
Rule = List[Dict[str, Any]]
LineTup = Tuple[int, str, str, str]
PYDELIMS = r'''"'()\[\]{}#\\'''
PYREG = r"[^{}]".format(PYDELIMS)
PYSQ = r'"(... | true | true |
1c2fba5a7b75cab145ff9a67266c2c28d6b40e9d | 5,333 | py | Python | nlpaug/model/lang_models/language_models.py | So-AI-love/nlpaug | 3aff5754609cb6bf092709d9af2089ccd55ffc93 | [
"MIT"
] | null | null | null | nlpaug/model/lang_models/language_models.py | So-AI-love/nlpaug | 3aff5754609cb6bf092709d9af2089ccd55ffc93 | [
"MIT"
] | null | null | null | nlpaug/model/lang_models/language_models.py | So-AI-love/nlpaug | 3aff5754609cb6bf092709d9af2089ccd55ffc93 | [
"MIT"
] | null | null | null | try:
import torch
import torch.nn.functional as F
except ImportError:
# No installation required if not using this function
pass
import numpy as np
import string
import nlpaug.util.selection.filtering as filtering
class LanguageModels:
OPTIMIZE_ATTRIBUTES = ['external_memory', 'return_proba']
... | 35.317881 | 144 | 0.624602 | try:
import torch
import torch.nn.functional as F
except ImportError:
pass
import numpy as np
import string
import nlpaug.util.selection.filtering as filtering
class LanguageModels:
OPTIMIZE_ATTRIBUTES = ['external_memory', 'return_proba']
def __init__(self, device='cpu', temperature=1.0, t... | true | true |
1c2fbae5ecfebac86fe0e32e8e1486af950d1fe0 | 2,988 | py | Python | models/others/lsa.py | dahyun-kang/renet | 43a4e5af96b56c99a0cd63e35bd272db72f7f3a4 | [
"MIT"
] | 50 | 2021-08-18T23:41:16.000Z | 2022-03-09T03:08:40.000Z | models/others/lsa.py | ChiaraDom18/renet | b58ebc092fcdb40e7f534f6407512df4f109cacd | [
"MIT"
] | 6 | 2021-08-31T11:55:36.000Z | 2022-02-10T02:16:27.000Z | models/others/lsa.py | ChiaraDom18/renet | b58ebc092fcdb40e7f534f6407512df4f109cacd | [
"MIT"
] | 11 | 2021-08-30T08:36:36.000Z | 2022-03-22T07:21:45.000Z | """ code references: https://github.com/leaderj1001/Stand-Alone-Self-Attention """
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
class LocalSelfAttention(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, groups=1, bias=F... | 43.941176 | 135 | 0.66834 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
class LocalSelfAttention(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, groups=1, bias=False):
super(LocalSelfAttention, self).__init__()
self.out_channels... | true | true |
1c2fbb148908d1bc8211429d7a1d2e851c65fc4a | 2,081 | py | Python | autosuspend_mcstatus/activity.py | nikp123/autosuspend-mcstatus | 0fec99e9ee6fa961bfafdd677684290495fcdcbf | [
"MIT"
] | null | null | null | autosuspend_mcstatus/activity.py | nikp123/autosuspend-mcstatus | 0fec99e9ee6fa961bfafdd677684290495fcdcbf | [
"MIT"
] | null | null | null | autosuspend_mcstatus/activity.py | nikp123/autosuspend-mcstatus | 0fec99e9ee6fa961bfafdd677684290495fcdcbf | [
"MIT"
] | null | null | null | from typing import *
import configparser
import socket
from mcstatus import MinecraftServer
from autosuspend.checks import Activity, ConfigurationError
from .util import MCStatusMixin
class ServerOnline(Activity, MCStatusMixin):
@classmethod
def create(cls, name: str, config: configparser.SectionProxy) -> "Ser... | 35.87931 | 85 | 0.635272 | from typing import *
import configparser
import socket
from mcstatus import MinecraftServer
from autosuspend.checks import Activity, ConfigurationError
from .util import MCStatusMixin
class ServerOnline(Activity, MCStatusMixin):
@classmethod
def create(cls, name: str, config: configparser.SectionProxy) -> "Ser... | true | true |
1c2fbb6630d7d1f4de8a8b6f7db503ab9258f7c7 | 1,544 | py | Python | models/layers/linears.py | MachineWei/ChineseNer | fae4dfb0498c2f1f7dfafee70fa47c935266bfaf | [
"MIT"
] | 1 | 2021-08-28T11:45:18.000Z | 2021-08-28T11:45:18.000Z | models/layers/linears.py | MachineWei/bert-crf-for-ner | fae4dfb0498c2f1f7dfafee70fa47c935266bfaf | [
"MIT"
] | null | null | null | models/layers/linears.py | MachineWei/bert-crf-for-ner | fae4dfb0498c2f1f7dfafee70fa47c935266bfaf | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
# from torch.modeling_utils import PoolerStartLogits, PoolerEndLogits
class FeedForwardNetwork(nn.Module):
def __init__(self, input_size, hidden_size, output_size, dropout_rate=0):
super(FeedForwardNetwork, self).__init__()
self.dro... | 36.761905 | 96 | 0.69171 | import torch
import torch.nn as nn
import torch.nn.functional as F
class FeedForwardNetwork(nn.Module):
def __init__(self, input_size, hidden_size, output_size, dropout_rate=0):
super(FeedForwardNetwork, self).__init__()
self.dropout_rate = dropout_rate
self.linear1 = nn.Linear(input_size,... | true | true |
1c2fbc32946418c6d20fc9cc650f8583cf072fe2 | 536 | py | Python | src/thenewboston/transactions/validation.py | achalpatel/thenewboston-python | 4044ce07cb5e0d1f92b4332bbd8c6ac8f33bcdb9 | [
"MIT"
] | 122 | 2020-07-12T23:08:49.000Z | 2021-12-18T16:14:10.000Z | src/thenewboston/transactions/validation.py | achalpatel/thenewboston-python | 4044ce07cb5e0d1f92b4332bbd8c6ac8f33bcdb9 | [
"MIT"
] | 47 | 2020-07-15T02:18:09.000Z | 2021-09-22T19:51:59.000Z | src/thenewboston/transactions/validation.py | achalpatel/thenewboston-python | 4044ce07cb5e0d1f92b4332bbd8c6ac8f33bcdb9 | [
"MIT"
] | 52 | 2020-07-13T10:49:52.000Z | 2021-10-30T03:34:55.000Z | def validate_transaction_exists(*, amount, fee, error, recipient, txs):
"""Check for the existence of a Tx"""
tx = next(
(
tx for tx in txs if
tx.get('amount') >= amount
and tx.get('fee') == fee
and tx.get('recipient') == recipient
),
None
... | 26.8 | 71 | 0.494403 | def validate_transaction_exists(*, amount, fee, error, recipient, txs):
tx = next(
(
tx for tx in txs if
tx.get('amount') >= amount
and tx.get('fee') == fee
and tx.get('recipient') == recipient
),
None
)
if not tx:
raise error(... | true | true |
1c2fbd6abc51e920a13f546a06ef5107166764c0 | 21,025 | py | Python | PC/utils/scheduler.py | StanLei52/GEBD | 5f7e722e0384f9877c75d116e1db72400d2bc58f | [
"MIT"
] | 44 | 2021-03-24T07:10:57.000Z | 2022-03-12T11:49:14.000Z | PC/utils/scheduler.py | StanLei52/GEBD | 5f7e722e0384f9877c75d116e1db72400d2bc58f | [
"MIT"
] | 2 | 2021-05-26T09:31:55.000Z | 2021-08-11T11:47:38.000Z | PC/utils/scheduler.py | StanLei52/GEBD | 5f7e722e0384f9877c75d116e1db72400d2bc58f | [
"MIT"
] | 6 | 2021-04-07T00:51:51.000Z | 2022-01-12T01:54:41.000Z | from typing import Dict, Any
import torch
import math
import logging
import numpy as np
_logger = logging.getLogger(__name__)
class Scheduler:
""" Parameter Scheduler Base Class
A scheduler base class that can be used to schedule any optimizer parameter groups.
Unlike the builtin PyTorch schedulers, th... | 38.577982 | 121 | 0.571082 | from typing import Dict, Any
import torch
import math
import logging
import numpy as np
_logger = logging.getLogger(__name__)
class Scheduler:
def __init__(self,
optimizer: torch.optim.Optimizer,
param_group_field: str,
noise_range_t=None,
no... | true | true |
1c2fbd7e9cc84b577c89dfb84de3fe84522eb5fe | 2,636 | py | Python | Missions_to_Mars/.history/scrape_mars_20200809061221.py | ermiasgelaye/web-scraping-challenge | f99c3436dfb0169595c46dae7733d90e21385cc6 | [
"ADSL"
] | null | null | null | Missions_to_Mars/.history/scrape_mars_20200809061221.py | ermiasgelaye/web-scraping-challenge | f99c3436dfb0169595c46dae7733d90e21385cc6 | [
"ADSL"
] | null | null | null | Missions_to_Mars/.history/scrape_mars_20200809061221.py | ermiasgelaye/web-scraping-challenge | f99c3436dfb0169595c46dae7733d90e21385cc6 | [
"ADSL"
] | 2 | 2020-11-02T08:12:16.000Z | 2021-05-17T21:45:42.000Z | # Dependencies
import numpy as np
import pandas as pd
from bs4 import BeautifulSoup as bs
import requests
from splinter import Browser
import re
import time
# Initialize browser
def init_browser():
executable_path = {"executable_path": "/usr/local/bin/chromedriver"}
#executable_path = {'executable_path': 'ch... | 31.759036 | 96 | 0.649469 |
import numpy as np
import pandas as pd
from bs4 import BeautifulSoup as bs
import requests
from splinter import Browser
import re
import time
def init_browser():
executable_path = {"executable_path": "/usr/local/bin/chromedriver"}
return Browser("chrome", **executable_path, headless=False)
def scrap... | true | true |
1c2fbd99e8a358645cbd1a49f7f62034df8161ae | 5,189 | py | Python | condoor/actions.py | kstaniek/condoor-ng | adbe6d37b5978e17237e41051525ab59c589adbc | [
"Apache-2.0"
] | null | null | null | condoor/actions.py | kstaniek/condoor-ng | adbe6d37b5978e17237e41051525ab59c589adbc | [
"Apache-2.0"
] | 6 | 2016-12-07T05:55:13.000Z | 2017-01-07T02:52:55.000Z | condoor/actions.py | kstaniek/condoor-ng | adbe6d37b5978e17237e41051525ab59c589adbc | [
"Apache-2.0"
] | null | null | null | """Provides predefined actions for Finite State Machines."""
import logging
from condoor.fsm import action
from condoor.exceptions import ConnectionAuthenticationError, ConnectionError, ConnectionTimeoutError
@action
def a_send_line(text, ctx):
"""Send text line to the controller followed by `os.linesep`."""
... | 26.747423 | 111 | 0.695895 | import logging
from condoor.fsm import action
from condoor.exceptions import ConnectionAuthenticationError, ConnectionError, ConnectionTimeoutError
@action
def a_send_line(text, ctx):
ctx.ctrl.sendline(text)
return True
@action
def a_send(text, ctx):
ctx.ctrl.send(text)
return True
@action
def a_s... | true | true |
1c2fbe6b562df5257fec1a80f3d6038e91915a3f | 3,740 | py | Python | staves/runtimes/docker.py | digitalernachschub/staves | 8b96e018ebd79e18b446e931eb8a04dc5e3a8a87 | [
"Apache-2.0"
] | 11 | 2020-05-14T16:25:34.000Z | 2022-01-06T07:25:37.000Z | staves/runtimes/docker.py | digitalernachschub/staves | 8b96e018ebd79e18b446e931eb8a04dc5e3a8a87 | [
"Apache-2.0"
] | null | null | null | staves/runtimes/docker.py | digitalernachschub/staves | 8b96e018ebd79e18b446e931eb8a04dc5e3a8a87 | [
"Apache-2.0"
] | null | null | null | import io
import json
import logging
import os
import socket
import struct
import tarfile
from dataclasses import asdict
from pathlib import Path
from typing import Mapping
import docker
from docker.types import Mount
import staves.builders.gentoo as gentoo_builder
from staves.builders.gentoo import ImageSpec
logger... | 30.655738 | 88 | 0.622727 | import io
import json
import logging
import os
import socket
import struct
import tarfile
from dataclasses import asdict
from pathlib import Path
from typing import Mapping
import docker
from docker.types import Mount
import staves.builders.gentoo as gentoo_builder
from staves.builders.gentoo import ImageSpec
logger... | true | true |
1c2fbea4b7cf369327216abf4b9b0f4d2b266cd6 | 3,661 | py | Python | build/PureCloudPlatformClientV2/models/week_shift_trade_list_response.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | 10 | 2019-02-22T00:27:08.000Z | 2021-09-12T23:23:44.000Z | libs/PureCloudPlatformClientV2/models/week_shift_trade_list_response.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | 5 | 2018-06-07T08:32:00.000Z | 2021-07-28T17:37:26.000Z | libs/PureCloudPlatformClientV2/models/week_shift_trade_list_response.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | 6 | 2020-04-09T17:43:07.000Z | 2022-02-17T08:48:05.000Z | # coding: utf-8
"""
Copyright 2016 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | 27.946565 | 77 | 0.580716 |
from pprint import pformat
from six import iteritems
import re
import json
from ..utils import sanitize_for_serialization
class WeekShiftTradeListResponse(object):
def __init__(self):
self.swagger_types = {
'entities': 'list[WeekShiftTradeResponse]'
}
self.attribute_map = {... | true | true |
1c2fbf246556300f28b607ea53fca3967c6adc28 | 7,777 | py | Python | build/python-env/lib/python2.7/site-packages/docker/models/networks.py | imiMoisesEducation/beatcookie-discbot | 59c8be23346d8d2fc1777a2b08856df88e2ae5c2 | [
"Apache-2.0"
] | 20 | 2018-05-08T20:41:48.000Z | 2019-08-15T02:15:58.000Z | build/python-env/lib/python2.7/site-packages/docker/models/networks.py | imiMoisesEducation/beatcookie-discbot | 59c8be23346d8d2fc1777a2b08856df88e2ae5c2 | [
"Apache-2.0"
] | 2 | 2021-02-02T22:48:24.000Z | 2021-06-02T02:04:53.000Z | build/python-env/lib/python2.7/site-packages/docker/models/networks.py | imiMoisesEducation/beatcookie-discbot | 59c8be23346d8d2fc1777a2b08856df88e2ae5c2 | [
"Apache-2.0"
] | 5 | 2018-07-03T03:15:01.000Z | 2020-09-10T06:30:27.000Z | from ..api import APIClient
from ..utils import version_gte
from .containers import Container
from .resource import Model, Collection
class Network(Model):
"""
A Docker network.
"""
@property
def name(self):
"""
The name of the network.
"""
return self.attrs.get('Na... | 36.00463 | 79 | 0.555098 | from ..api import APIClient
from ..utils import version_gte
from .containers import Container
from .resource import Model, Collection
class Network(Model):
@property
def name(self):
return self.attrs.get('Name')
@property
def containers(self):
return [
self.client.containe... | true | true |
1c2fbffd53700052b6c2bf61434722bcee5798b7 | 1,336 | py | Python | setup.py | albmarin/pcuf | 90fe58a5373d4afb46d95486ced91976e13e2f90 | [
"BSD-3-Clause"
] | null | null | null | setup.py | albmarin/pcuf | 90fe58a5373d4afb46d95486ced91976e13e2f90 | [
"BSD-3-Clause"
] | 247 | 2020-02-19T05:55:58.000Z | 2022-03-28T13:43:12.000Z | setup.py | albmarin/pcuf | 90fe58a5373d4afb46d95486ced91976e13e2f90 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open("README.rst") as readme_file:
readme = readme_file.read()
with open("HISTORY.rst") as history_file:
history = history_file.read()
requirements = [
"xlrd>=1.2.0",
"pandas>=0.24... | 25.692308 | 88 | 0.643713 |
from setuptools import setup, find_packages
with open("README.rst") as readme_file:
readme = readme_file.read()
with open("HISTORY.rst") as history_file:
history = history_file.read()
requirements = [
"xlrd>=1.2.0",
"pandas>=0.24.1",
"requests>=2.21.0",
"click>=7.0",
"openpyxl>=2.5.12... | true | true |
1c2fc0173c6d37b75e054681031b636b7288fb33 | 8,657 | py | Python | 2015/day_03/day_03_part_2.py | Sancti0n/advent-of-code | 360c20f63c2308439e2e191c60b7164be86c4d4a | [
"MIT"
] | null | null | null | 2015/day_03/day_03_part_2.py | Sancti0n/advent-of-code | 360c20f63c2308439e2e191c60b7164be86c4d4a | [
"MIT"
] | null | null | null | 2015/day_03/day_03_part_2.py | Sancti0n/advent-of-code | 360c20f63c2308439e2e191c60b7164be86c4d4a | [
"MIT"
] | null | null | null | path = '^^<<v<<v><v^^<><>^^<v<v^>>^^^><^>v^>v><><><<vv^^<^>^^<v^>v>v^v>>>^<>v<^<v^><^>>>>><<v>>^>>^>v^>><<^>v>v<>^v^v^vvv><>^^>v><v<><>^><^^<vv^v<v>^v>>^v^>v><>v^<vv>^><<v^>vv^<<>v>>><<<>>^<vv<^<>^^vv>>>^><<<<vv^v^>>><><^>v<>^>v<v^v<^vv><^v^><<<<>^<>v>^v>v<v<v<<>v<^<<<v>>>>>^^v>vv^^<>^<>^^^^<^^^v<v^^>v<^^v^^>v>^v^^^^>>... | 480.944444 | 8,201 | 0.258866 | path = '^^<<v<<v><v^^<><>^^<v<v^>>^^^><^>v^>v><><><<vv^^<^>^^<v^>v>v^v>>>^<>v<^<v^><^>>>>><<v>>^>>^>v^>><<^>v>v<>^v^v^vvv><>^^>v><v<><>^><^^<vv^v<v>^v>>^v^>v><>v^<vv>^><<v^>vv^<<>v>>><<<>>^<vv<^<>^^vv>>>^><<<<vv^v^>>><><^>v<>^>v<v^v<^vv><^v^><<<<>^<>v>^v>v<v<v<<>v<^<<<v>>>>>^^v>vv^^<>^<>^^^^<^^^v<v^^>v<^^v^^>v>^v^^^^>>... | true | true |
1c2fc07b459c8bfbe90b2101897c68347d65049c | 2,950 | py | Python | pyreaclib/amemass/ame_nuclide.py | jennranta/pyreaclib | bd9210153b0c01c7ce230b43b88f0a5a1e198c0f | [
"BSD-3-Clause"
] | null | null | null | pyreaclib/amemass/ame_nuclide.py | jennranta/pyreaclib | bd9210153b0c01c7ce230b43b88f0a5a1e198c0f | [
"BSD-3-Clause"
] | null | null | null | pyreaclib/amemass/ame_nuclide.py | jennranta/pyreaclib | bd9210153b0c01c7ce230b43b88f0a5a1e198c0f | [
"BSD-3-Clause"
] | null | null | null | # Common Imports
from __future__ import print_function
class AMENuclide(object):
def __init__(self, n=None, z=None, a=None, element=None, origin=None,
mexcess=None, d_mexcess=None, nucbind=None,
d_nucbind=None, decay_type=None, ebeta=None,
d_ebeta=None, mass=None,... | 29.79798 | 73 | 0.530847 |
from __future__ import print_function
class AMENuclide(object):
def __init__(self, n=None, z=None, a=None, element=None, origin=None,
mexcess=None, d_mexcess=None, nucbind=None,
d_nucbind=None, decay_type=None, ebeta=None,
d_ebeta=None, mass=None, d_mass=None):
... | true | true |
1c2fc0eaac66c2170fc9e708497eb4ba1c41f83a | 2,412 | py | Python | astropy/constants/utils.py | MatiasRepetto/astropy | 689f9d3b063145150149e592a879ee40af1fac06 | [
"BSD-3-Clause"
] | 1 | 2019-03-11T12:26:49.000Z | 2019-03-11T12:26:49.000Z | astropy/constants/utils.py | MatiasRepetto/astropy | 689f9d3b063145150149e592a879ee40af1fac06 | [
"BSD-3-Clause"
] | 1 | 2019-10-09T18:54:27.000Z | 2019-10-09T18:54:27.000Z | astropy/constants/utils.py | MatiasRepetto/astropy | 689f9d3b063145150149e592a879ee40af1fac06 | [
"BSD-3-Clause"
] | 1 | 2020-02-18T04:10:00.000Z | 2020-02-18T04:10:00.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Utility functions for ``constants`` sub-package."""
import itertools
__all__ = []
def _get_c(codata, iaudata, module, not_in_module_only=True):
"""
Generator to return a Constant object.
Parameters
----------
codata, iaudata : ob... | 29.777778 | 77 | 0.596186 |
import itertools
__all__ = []
def _get_c(codata, iaudata, module, not_in_module_only=True):
from .constant import Constant
for _nm, _c in itertools.chain(sorted(vars(codata).items()),
sorted(vars(iaudata).items())):
if not isinstance(_c, Constant):
con... | true | true |
1c2fc1bdd77a98dff2241412a763ab542480c417 | 7,213 | py | Python | Lib/site-packages/openpyxl/workbook/defined_name.py | percevalm/aumyproject | b24b38005188ce9dd41ed663cf54dad5464afef3 | [
"bzip2-1.0.6"
] | 1 | 2017-10-31T02:37:37.000Z | 2017-10-31T02:37:37.000Z | Lib/site-packages/openpyxl/workbook/defined_name.py | percevalm/aumyproject | b24b38005188ce9dd41ed663cf54dad5464afef3 | [
"bzip2-1.0.6"
] | 16 | 2020-03-24T17:30:37.000Z | 2022-03-11T23:57:41.000Z | Lib/site-packages/openpyxl/workbook/defined_name.py | percevalm/aumyproject | b24b38005188ce9dd41ed663cf54dad5464afef3 | [
"bzip2-1.0.6"
] | null | null | null | from __future__ import absolute_import
# Copyright (c) 2010-2017 openpyxl
import re
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Alias,
Typed,
String,
Float,
Integer,
Bool,
NoneSet,
Set,
Sequence,
Descriptor,
)
from openpyxl.comp... | 27.530534 | 91 | 0.579093 | from __future__ import absolute_import
import re
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Alias,
Typed,
String,
Float,
Integer,
Bool,
NoneSet,
Set,
Sequence,
Descriptor,
)
from openpyxl.compat import safe_string
from openpyx... | true | true |
1c2fc1e3ad518f905ac5ccdd97c9c53482b06b2c | 8,778 | py | Python | danceschool/financial/handlers.py | django-danceschool/django-danceschool | 65ae09ffdcb0821e82df0e1f634fe13c0384a525 | [
"BSD-3-Clause"
] | 32 | 2017-09-12T04:25:25.000Z | 2022-03-21T10:48:07.000Z | danceschool/financial/handlers.py | django-danceschool/django-danceschool | 65ae09ffdcb0821e82df0e1f634fe13c0384a525 | [
"BSD-3-Clause"
] | 97 | 2017-09-01T02:43:08.000Z | 2022-01-03T18:20:34.000Z | danceschool/financial/handlers.py | django-danceschool/django-danceschool | 65ae09ffdcb0821e82df0e1f634fe13c0384a525 | [
"BSD-3-Clause"
] | 19 | 2017-09-26T13:34:46.000Z | 2022-03-21T10:48:10.000Z | from django.dispatch import receiver
from django.db.models import Q, Value, CharField, F
from django.db.models.query import QuerySet
from django.db.models.signals import post_save, m2m_changed
from django.utils.translation import gettext_lazy as _
from django.contrib.auth.models import User
import sys
import logging
... | 39.719457 | 105 | 0.692755 | from django.dispatch import receiver
from django.db.models import Q, Value, CharField, F
from django.db.models.query import QuerySet
from django.db.models.signals import post_save, m2m_changed
from django.utils.translation import gettext_lazy as _
from django.contrib.auth.models import User
import sys
import logging
... | true | true |
1c2fc3209f2199d9779888529609d26bf3a2c41a | 3,245 | py | Python | twittertennis/handler_utils.py | ferencberes/twittertennis | d9a21655c3e5c3599fe4149904c967ed67139569 | [
"CC0-1.0"
] | null | null | null | twittertennis/handler_utils.py | ferencberes/twittertennis | d9a21655c3e5c3599fe4149904c967ed67139569 | [
"CC0-1.0"
] | null | null | null | twittertennis/handler_utils.py | ferencberes/twittertennis | d9a21655c3e5c3599fe4149904c967ed67139569 | [
"CC0-1.0"
] | null | null | null | import pandas as pd
import networkx as nx
from collections import Counter
### EDGES ###
def groupby_count(df, group_cols, count_col):
parts = [df[col] for col in group_cols]
tuples = list(zip(*parts))
cnt = Counter(tuples)
keys, counts = zip(*list(cnt.items()))
res = pd.DataFrame(keys, columns=gro... | 37.298851 | 162 | 0.678274 | import pandas as pd
import networkx as nx
from collections import Counter
_cols, count_col):
parts = [df[col] for col in group_cols]
tuples = list(zip(*parts))
cnt = Counter(tuples)
keys, counts = zip(*list(cnt.items()))
res = pd.DataFrame(keys, columns=group_cols)
res[count_col] = counts
r... | true | true |
1c2fc51f8b3649c1bd241cd9d62b5618aa991773 | 700 | py | Python | pybind/slxos/v16r_1_00b/no/fcsp/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/no/fcsp/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/no/fcsp/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 33.333333 | 102 | 0.808571 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | true | true |
1c2fc5e3838e7f3766ffd4648fa5a200e09d866f | 2,394 | py | Python | 145-Binary-Tree-Postorder-Traversal/solution.py | Tanych/CodeTracking | 86f1cb98de801f58c39d9a48ce9de12df7303d20 | [
"MIT"
] | null | null | null | 145-Binary-Tree-Postorder-Traversal/solution.py | Tanych/CodeTracking | 86f1cb98de801f58c39d9a48ce9de12df7303d20 | [
"MIT"
] | null | null | null | 145-Binary-Tree-Postorder-Traversal/solution.py | Tanych/CodeTracking | 86f1cb98de801f58c39d9a48ce9de12df7303d20 | [
"MIT"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def reverse(self,from_node,to_node):
if from_node==to_node:
return
a,b,c=from_node,from_node.... | 28.164706 | 66 | 0.447786 |
class Solution(object):
def reverse(self,from_node,to_node):
if from_node==to_node:
return
a,b,c=from_node,from_node.right,None
while True:
c=b.right
b.right=a
a=b
b=c
if a==to_node:break
def rev... | true | true |
1c2fc5e42bff60eaaacc0ac9a42e4f4b9325450c | 9,723 | py | Python | scripts/external_libs/jsonpickle-2.0.0/tests/pandas_test.py | GabrielGanne/trex-core | 688a0fe0adb890964691473723d70ffa98e00dd3 | [
"Apache-2.0"
] | 956 | 2015-06-24T15:04:55.000Z | 2022-03-30T06:25:04.000Z | scripts/external_libs/jsonpickle-2.0.0/tests/pandas_test.py | hjat2005/trex-core | 400f03c86c844a0096dff3f6b13e58a808aaefff | [
"Apache-2.0"
] | 782 | 2015-09-20T15:19:00.000Z | 2022-03-31T23:52:05.000Z | scripts/external_libs/jsonpickle-2.0.0/tests/pandas_test.py | hjat2005/trex-core | 400f03c86c844a0096dff3f6b13e58a808aaefff | [
"Apache-2.0"
] | 429 | 2015-06-27T19:34:21.000Z | 2022-03-23T11:02:51.000Z | from __future__ import absolute_import, division, unicode_literals
import datetime
import pytest
try:
import pandas as pd
import numpy as np
from pandas.testing import assert_series_equal
from pandas.testing import assert_frame_equal
from pandas.testing import assert_index_equal
except ImportError... | 31.364516 | 81 | 0.622236 | from __future__ import absolute_import, division, unicode_literals
import datetime
import pytest
try:
import pandas as pd
import numpy as np
from pandas.testing import assert_series_equal
from pandas.testing import assert_frame_equal
from pandas.testing import assert_index_equal
except ImportError... | true | true |
1c2fc604ac3d747626eaa5c5d0cc9a69eace435f | 1,293 | py | Python | worker/tasks/db_writer.py | ZTJiu/WebsiteIpParser | 173703a03e329cb9488a9637e84b421a1ed20a19 | [
"Apache-2.0"
] | null | null | null | worker/tasks/db_writer.py | ZTJiu/WebsiteIpParser | 173703a03e329cb9488a9637e84b421a1ed20a19 | [
"Apache-2.0"
] | null | null | null | worker/tasks/db_writer.py | ZTJiu/WebsiteIpParser | 173703a03e329cb9488a9637e84b421a1ed20a19 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding=utf-8 -*-
###########################################
# File : db_writer.py
# Date : 2017-09-17
# Author: Zhang Tianjiu
# Email : zhangtianjiu@vip.qq.com
###########################################
from sqlalchemy import Table, MetaData, Column, String, create_engine
from sqlalchem... | 23.509091 | 71 | 0.615623 | true | true | |
1c2fc67455b0e53a2eb879e29cb998a2ac40df9f | 3,463 | py | Python | app/tests/testDownload.py | lhorne-gavant/OpenPubArchive-Content-Server-1 | 2b7c02417a8bb37f5a627343fab7fa05dc532bf7 | [
"Apache-2.0"
] | null | null | null | app/tests/testDownload.py | lhorne-gavant/OpenPubArchive-Content-Server-1 | 2b7c02417a8bb37f5a627343fab7fa05dc532bf7 | [
"Apache-2.0"
] | null | null | null | app/tests/testDownload.py | lhorne-gavant/OpenPubArchive-Content-Server-1 | 2b7c02417a8bb37f5a627343fab7fa05dc532bf7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Third-party imports...
#from nose.tools import assert_true
# This test module is in development...
import sys
import os.path
folder = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
if folder == "tests": # testing from within WingIDE, default folder is t... | 38.477778 | 126 | 0.674848 |
import sys
import os.path
folder = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
if folder == "tests":
sys.path.append('../libs')
sys.path.append('../config')
sys.path.append('../../app')
else:
sys.path.append('./libs')
sys.path.append('./config')
from starlette.testclien... | true | true |
1c2fc75c25ffb9aca3dbac7b67593a66e503ab2c | 2,021 | py | Python | accounts/forms.py | Nor-Mal/django-ecommerce | e57d316cb78fbe4315fb0a4b07a79779143981dd | [
"Apache-2.0"
] | 2 | 2021-09-05T20:45:59.000Z | 2021-11-03T11:55:20.000Z | accounts/forms.py | Nor-Mal/django-ecommerce | e57d316cb78fbe4315fb0a4b07a79779143981dd | [
"Apache-2.0"
] | null | null | null | accounts/forms.py | Nor-Mal/django-ecommerce | e57d316cb78fbe4315fb0a4b07a79779143981dd | [
"Apache-2.0"
] | null | null | null | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import get_user_model
from .models import Customer, Address
class UserCreateForm(UserCreationForm):
class Meta:
fields = ('username', 'first_name', 'last_name', 'email', 'password1', 'passwor... | 33.131148 | 95 | 0.620485 | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import get_user_model
from .models import Customer, Address
class UserCreateForm(UserCreationForm):
class Meta:
fields = ('username', 'first_name', 'last_name', 'email', 'password1', 'passwor... | true | true |
1c2fc7a04f19443bfe8f1d68c70f77000c87265a | 482 | py | Python | api/models/images.py | syth0le/async_cookeat | 0cecdd44c064be6fe19c0d0ae8342d7baf5a9bb8 | [
"CC0-1.0"
] | null | null | null | api/models/images.py | syth0le/async_cookeat | 0cecdd44c064be6fe19c0d0ae8342d7baf5a9bb8 | [
"CC0-1.0"
] | null | null | null | api/models/images.py | syth0le/async_cookeat | 0cecdd44c064be6fe19c0d0ae8342d7baf5a9bb8 | [
"CC0-1.0"
] | null | null | null | from sqlalchemy import Column, String, Integer, ForeignKey
from sqlalchemy.orm import relationship
from api.utils.db_init import Base
class Images(Base):
__tablename__ = 'images'
id = Column(Integer, primary_key=True, unique=True)
image = Column(String(50), nullable=False)
recipe_id = Column(Integer... | 26.777778 | 66 | 0.717842 | from sqlalchemy import Column, String, Integer, ForeignKey
from sqlalchemy.orm import relationship
from api.utils.db_init import Base
class Images(Base):
__tablename__ = 'images'
id = Column(Integer, primary_key=True, unique=True)
image = Column(String(50), nullable=False)
recipe_id = Column(Integer... | true | true |
1c2fc82b12fbba10922a54228785c5d486281380 | 66 | py | Python | streamfig/__init__.py | TiphaineV/streamfig | 4acd92625c34bde0089b7963ec076d902d8ebba1 | [
"MIT"
] | 5 | 2019-09-19T07:11:13.000Z | 2021-12-13T11:18:41.000Z | streamfig/__init__.py | TiphaineV/streamfig | 4acd92625c34bde0089b7963ec076d902d8ebba1 | [
"MIT"
] | 3 | 2020-04-23T17:37:23.000Z | 2021-12-13T09:40:31.000Z | streamfig/__init__.py | TiphaineV/streamfig | 4acd92625c34bde0089b7963ec076d902d8ebba1 | [
"MIT"
] | 5 | 2018-12-14T13:53:33.000Z | 2020-05-18T17:22:52.000Z | from .streamfig import StreamFig
from .printers import FigPrinter
| 22 | 32 | 0.848485 | from .streamfig import StreamFig
from .printers import FigPrinter
| true | true |
1c2fc89fac73d58e54ab12a3e1de3df8b88365e0 | 26,158 | py | Python | kiali_qe/tests/test_istio_config_validation.py | Hawkular-QE/kiali-qe-python | 24e058def1efd0a509a2b599901f4179dbf37583 | [
"Apache-2.0"
] | null | null | null | kiali_qe/tests/test_istio_config_validation.py | Hawkular-QE/kiali-qe-python | 24e058def1efd0a509a2b599901f4179dbf37583 | [
"Apache-2.0"
] | 3 | 2018-03-28T17:11:13.000Z | 2018-03-28T17:55:08.000Z | kiali_qe/tests/test_istio_config_validation.py | Hawkular-QE/kiali-qe-python | 24e058def1efd0a509a2b599901f4179dbf37583 | [
"Apache-2.0"
] | 2 | 2018-02-13T10:56:03.000Z | 2018-03-20T14:07:51.000Z | import pytest
from selenium.common.exceptions import NoSuchElementException
from kiali_qe.tests import ValidationsTest, ConfigValidationObject, ServiceValidationObject
from kiali_qe.utils.path import istio_objects_validation_path
from kiali_qe.components.error_codes import (
KIA0205,
KIA0401,
KIA0301,
... | 36.08 | 98 | 0.652038 | import pytest
from selenium.common.exceptions import NoSuchElementException
from kiali_qe.tests import ValidationsTest, ConfigValidationObject, ServiceValidationObject
from kiali_qe.utils.path import istio_objects_validation_path
from kiali_qe.components.error_codes import (
KIA0205,
KIA0401,
KIA0301,
... | true | true |
1c2fc8f9475fca07fd19d084ffbe32021b3ce474 | 7,459 | py | Python | probatus/utils/shap_helpers.py | PaulZhutovsky/probatus | d8f85dc0eac65a7fec64b76f265693c845afcbe2 | [
"MIT"
] | null | null | null | probatus/utils/shap_helpers.py | PaulZhutovsky/probatus | d8f85dc0eac65a7fec64b76f265693c845afcbe2 | [
"MIT"
] | null | null | null | probatus/utils/shap_helpers.py | PaulZhutovsky/probatus | d8f85dc0eac65a7fec64b76f265693c845afcbe2 | [
"MIT"
] | null | null | null | # Copyright (c) 2020 ING Bank N.V.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distr... | 36.925743 | 120 | 0.667114 |
import warnings
import numpy as np
import pandas as pd
from shap import Explainer
from shap.explainers._tree import Tree
from shap.utils import sample
from sklearn.pipeline import Pipeline
def shap_calc(
model,
X,
return_explainer=False,
verbose=0,
sample_size=100,
approxi... | true | true |
1c2fc8fb4a8080d320c1086f19b7f02983c690e3 | 12,910 | py | Python | panel/io/server.py | nritsche/panel | 15aa31b1c78988d107b3ace765d3c0fec36188c8 | [
"BSD-3-Clause"
] | null | null | null | panel/io/server.py | nritsche/panel | 15aa31b1c78988d107b3ace765d3c0fec36188c8 | [
"BSD-3-Clause"
] | null | null | null | panel/io/server.py | nritsche/panel | 15aa31b1c78988d107b3ace765d3c0fec36188c8 | [
"BSD-3-Clause"
] | null | null | null | """
Utilities for creating bokeh Server instances.
"""
from __future__ import absolute_import, division, unicode_literals
import os
import signal
import sys
import threading
import uuid
from contextlib import contextmanager
from functools import partial
from types import FunctionType
from bokeh.document.events impor... | 34.518717 | 97 | 0.609992 | from __future__ import absolute_import, division, unicode_literals
import os
import signal
import sys
import threading
import uuid
from contextlib import contextmanager
from functools import partial
from types import FunctionType
from bokeh.document.events import ModelChangedEvent
from bokeh.server.server import Ser... | true | true |
1c2fc92aa9611edafd68b1d93acc7f621dcebf02 | 3,955 | py | Python | mpa/cls/exporter.py | openvinotoolkit/model_preparation_algorithm | 8d36bf5944837b7a3d22fc2c3a4cb93423619fc2 | [
"Apache-2.0"
] | null | null | null | mpa/cls/exporter.py | openvinotoolkit/model_preparation_algorithm | 8d36bf5944837b7a3d22fc2c3a4cb93423619fc2 | [
"Apache-2.0"
] | null | null | null | mpa/cls/exporter.py | openvinotoolkit/model_preparation_algorithm | 8d36bf5944837b7a3d22fc2c3a4cb93423619fc2 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
import os
import torch.onnx
from functools import partial
from mmcv.runner import load_checkpoint, wrap_fp16_model
from mmcls.models import build_classifier
from mpa.registry import STAGES
from .stage import ClsStage
from mpa.utils import... | 34.391304 | 95 | 0.570923 |
import os
import torch.onnx
from functools import partial
from mmcv.runner import load_checkpoint, wrap_fp16_model
from mmcls.models import build_classifier
from mpa.registry import STAGES
from .stage import ClsStage
from mpa.utils import mo_wrapper
from mpa.utils.logger import get_logger
import numpy as np
impor... | true | true |
1c2fca169471f7b3ec70ce30effce80a1c395acd | 747 | py | Python | micropsi_core/tests/test_statuslogger.py | Doik/micropsi2 | 35ef3b48d9da255939e8e7af0e00bbcc98597602 | [
"MIT"
] | null | null | null | micropsi_core/tests/test_statuslogger.py | Doik/micropsi2 | 35ef3b48d9da255939e8e7af0e00bbcc98597602 | [
"MIT"
] | null | null | null | micropsi_core/tests/test_statuslogger.py | Doik/micropsi2 | 35ef3b48d9da255939e8e7af0e00bbcc98597602 | [
"MIT"
] | 1 | 2019-01-07T21:33:18.000Z | 2019-01-07T21:33:18.000Z |
def test_statuslogger_does_not_overwrite_children(runtime, test_nodenet):
net = runtime.get_nodenet(test_nodenet)
sl = net.netapi.statuslogger
sl.info("Learning.Foo", sl.ACTIVE, progress=(5, 23))
sl.info("Learning", sl.SUCCESS, "Learning complete")
res, tree = runtime.get_status_tree(test_nodenet)... | 43.941176 | 73 | 0.676037 |
def test_statuslogger_does_not_overwrite_children(runtime, test_nodenet):
net = runtime.get_nodenet(test_nodenet)
sl = net.netapi.statuslogger
sl.info("Learning.Foo", sl.ACTIVE, progress=(5, 23))
sl.info("Learning", sl.SUCCESS, "Learning complete")
res, tree = runtime.get_status_tree(test_nodenet)... | true | true |
1c2fca5f62fd0ebc9291106c3ba7ee9313876a22 | 21,639 | py | Python | manim/scene/scene_file_writer.py | EpicEricEE/manim | 66d26380e526b44d10a405b474356acbbf1f6434 | [
"MIT"
] | 1 | 2021-04-19T18:01:55.000Z | 2021-04-19T18:01:55.000Z | manim/scene/scene_file_writer.py | EpicEricEE/manim | 66d26380e526b44d10a405b474356acbbf1f6434 | [
"MIT"
] | null | null | null | manim/scene/scene_file_writer.py | EpicEricEE/manim | 66d26380e526b44d10a405b474356acbbf1f6434 | [
"MIT"
] | 1 | 2021-03-31T20:46:51.000Z | 2021-03-31T20:46:51.000Z | """The interface between scenes and ffmpeg."""
__all__ = ["SceneFileWriter"]
import datetime
import os
import shutil
import subprocess
from pathlib import Path
from time import sleep
import numpy as np
from PIL import Image
from pydub import AudioSegment
from manim import __version__
from .. import config, logger
... | 35.885572 | 184 | 0.575674 |
__all__ = ["SceneFileWriter"]
import datetime
import os
import shutil
import subprocess
from pathlib import Path
from time import sleep
import numpy as np
from PIL import Image
from pydub import AudioSegment
from manim import __version__
from .. import config, logger
from ..constants import FFMPEG_BIN, GIF_FILE_EX... | true | true |
1c2fcab9e0c5719bddabf9a517978dbf7b670dfb | 5,708 | py | Python | openGaussBase/testcase/SQL/DML/copy/Opengauss_Function_DML_Copy_Case0113.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SQL/DML/copy/Opengauss_Function_DML_Copy_Case0113.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SQL/DML/copy/Opengauss_Function_DML_Copy_Case0113.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 39.638889 | 84 | 0.61405 |
import unittest
import os
from yat.test import Node
from yat.test import macro
from testcase.utils.Common import Common
from testcase.utils.CommonSH import CommonSH
from testcase.utils.Logger import Logger
from testcase.utils.Constant import Constant
class CopyFile(unittest.TestCase):
def setUp(self):
s... | true | true |
1c2fcaee24f6b4fdf6f998f4d35d716b58107bbf | 356 | py | Python | src/admin_utils/brief.py | ionelmc/django-admin-utils | d1c1d64a6d97f3589746c06352b21500d234209d | [
"BSD-2-Clause"
] | 14 | 2015-02-05T04:18:37.000Z | 2022-01-29T08:35:23.000Z | src/admin_utils/brief.py | mattcaldwell/django-admin-utils | a1bf8638111fa90dada9d39e515972668630f7be | [
"BSD-2-Clause"
] | null | null | null | src/admin_utils/brief.py | mattcaldwell/django-admin-utils | a1bf8638111fa90dada9d39e515972668630f7be | [
"BSD-2-Clause"
] | 3 | 2015-03-30T18:44:26.000Z | 2021-01-05T18:49:03.000Z | from django.contrib import admin
def register(model, site=admin.site):
def decorator(klass):
site.register(model, klass)
return klass
return decorator
def inline(model, klass=admin.TabularInline, **options):
return type(
"%sInlineAdmin" % model.__name__,
(klass,),
... | 20.941176 | 56 | 0.63764 | from django.contrib import admin
def register(model, site=admin.site):
def decorator(klass):
site.register(model, klass)
return klass
return decorator
def inline(model, klass=admin.TabularInline, **options):
return type(
"%sInlineAdmin" % model.__name__,
(klass,),
... | true | true |
1c2fcb490335c2e2fc92adb3893eecaaa49d33f2 | 1,436 | py | Python | pytext/loss/tests/ctc_loss_test.py | dmitryvinn/pytext | 43373462d1b9bada3ba02072aed78338d3bb3a12 | [
"BSD-3-Clause"
] | 6,199 | 2018-12-13T15:34:51.000Z | 2022-03-26T04:08:58.000Z | pytext/loss/tests/ctc_loss_test.py | dmitryvinn/pytext | 43373462d1b9bada3ba02072aed78338d3bb3a12 | [
"BSD-3-Clause"
] | 1,356 | 2018-12-13T15:50:33.000Z | 2022-03-03T20:45:58.000Z | pytext/loss/tests/ctc_loss_test.py | dmitryvinn/pytext | 43373462d1b9bada3ba02072aed78338d3bb3a12 | [
"BSD-3-Clause"
] | 842 | 2018-12-13T15:35:13.000Z | 2022-03-23T13:27:00.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import unittest
import torch
import torch.nn.functional as F
from pytext.loss.loss import CTCLoss
class CTCLossTest(unittest.TestCase):
def test_ctc_loss(self):
torch.manual_seed(0)
N = 16 # Batch siz... | 32.636364 | 88 | 0.629526 |
import unittest
import torch
import torch.nn.functional as F
from pytext.loss.loss import CTCLoss
class CTCLossTest(unittest.TestCase):
def test_ctc_loss(self):
torch.manual_seed(0)
N = 16
T = 50
C = 20
S = 30
S_min = 10
logits = torch.randn(... | true | true |
1c2fcf462232fd130a11832b921637407dc6a8a4 | 14,515 | py | Python | core/common.py | tangb/cleep-desktop | 7e333b0ce8445fad86216c4b51b1ade8c21695fd | [
"MIT"
] | 2 | 2020-07-31T13:24:05.000Z | 2022-03-10T08:44:06.000Z | core/common.py | tangb/cleep-desktop | 7e333b0ce8445fad86216c4b51b1ade8c21695fd | [
"MIT"
] | 6 | 2020-04-09T16:44:28.000Z | 2022-02-22T11:26:24.000Z | core/common.py | tangb/cleep-desktop | 7e333b0ce8445fad86216c4b51b1ade8c21695fd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file shares some constants and classes
"""
from core.exception import InvalidMessage
import copy
__all__ = ['CORE_MODULES', 'CATEGORIES', 'PeerInfos',
'ExecutionStep', 'MessageResponse', 'MessageRequest']
"""
CONSTANTS
"""
CORE_MODULES = [
'syste... | 29.989669 | 138 | 0.559283 |
from core.exception import InvalidMessage
import copy
__all__ = ['CORE_MODULES', 'CATEGORIES', 'PeerInfos',
'ExecutionStep', 'MessageResponse', 'MessageRequest']
CORE_MODULES = [
'system',
'update',
'audio',
'network',
'cleepbus',
'parameters'
]
class CATEGORIES(object):
... | true | true |
1c2fd346542e78afce69ecd41b77a94c70950c89 | 244 | py | Python | catalog/bindings/csw/exception.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/csw/exception.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/csw/exception.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from bindings.csw.exception_type import ExceptionType
__NAMESPACE__ = "http://www.opengis.net/ows"
@dataclass
class Exception(ExceptionType):
class Meta:
namespace = "http://www.opengis.net/ows"
| 22.181818 | 53 | 0.758197 | from dataclasses import dataclass
from bindings.csw.exception_type import ExceptionType
__NAMESPACE__ = "http://www.opengis.net/ows"
@dataclass
class Exception(ExceptionType):
class Meta:
namespace = "http://www.opengis.net/ows"
| true | true |
1c2fd3a10430ee151538db6ca511a9c5c6a5b7f2 | 36,429 | py | Python | test.py | Miraclelwk/learn-notes | 65ee8713a9477b6fe13ca93f787438f206fe6fd7 | [
"MIT"
] | null | null | null | test.py | Miraclelwk/learn-notes | 65ee8713a9477b6fe13ca93f787438f206fe6fd7 | [
"MIT"
] | null | null | null | test.py | Miraclelwk/learn-notes | 65ee8713a9477b6fe13ca93f787438f206fe6fd7 | [
"MIT"
] | null | null | null | """
# 多行注释
第一个注释
第二个注释
第三个注释
"""
"""
print("Hello,Python!!!")
# 缩进不同导致代码报错
if True:
print("1")
print("true")
else:
print("0")
print("false")
# 数字过长使用分隔符
print(100_100_100)
# 二进制表示
a = 0b10
print(a)
# 浮点型不能直接计算,会得到一个不精确的结果
b = 0.1 + 0.2
print(b)
# 引号指定字符串
s = 'Hello'
print(s)
# 不同引号之间才能嵌套
s = '子曰:"学而时习之,不... | 15.229515 | 105 | 0.556342 | true | true | |
1c2fd423183c48e273f5b744cb621c5dd8b65e84 | 1,751 | py | Python | NasAssesment/manage.py | siddshadab/Django_Assesment | a06ebf73bccd4e83b78391a1f70792cb5979ba8e | [
"MIT"
] | null | null | null | NasAssesment/manage.py | siddshadab/Django_Assesment | a06ebf73bccd4e83b78391a1f70792cb5979ba8e | [
"MIT"
] | null | null | null | NasAssesment/manage.py | siddshadab/Django_Assesment | a06ebf73bccd4e83b78391a1f70792cb5979ba8e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
import sqlite3
from sqlite3 import Error
import environ
from NasAssesment.settings import BASE_DIR
def create_connection(db_file):
conn = None
try:
conn = sqlite3.connect(db_file)
... | 28.241935 | 144 | 0.632781 |
import os
import sys
import sqlite3
from sqlite3 import Error
import environ
from NasAssesment.settings import BASE_DIR
def create_connection(db_file):
conn = None
try:
conn = sqlite3.connect(db_file)
except Error as e:
print(e)
return conn
def update_task(conn,id):... | true | true |
1c2fd450d2aa0c4510a90e6e5a7df1a0957949f4 | 1,575 | py | Python | tests/create_images.py | neurodata/ndex | c4d84e3be16de1ff53028d3bb1efd770790759af | [
"Apache-2.0"
] | 4 | 2018-12-03T14:08:35.000Z | 2020-07-24T06:19:10.000Z | tests/create_images.py | neurodata/ndex | c4d84e3be16de1ff53028d3bb1efd770790759af | [
"Apache-2.0"
] | null | null | null | tests/create_images.py | neurodata/ndex | c4d84e3be16de1ff53028d3bb1efd770790759af | [
"Apache-2.0"
] | null | null | null | import math
import os
import numpy as np
import png
import tifffile as tiff
def create_img_file(x_size, y_size, dtype, file_format, img_fname, intensity_range=None):
if intensity_range is None:
bit_width = int(''.join(filter(str.isdigit, dtype)))
else:
bit_width = round(math.log(intensity_ran... | 34.23913 | 89 | 0.641905 | import math
import os
import numpy as np
import png
import tifffile as tiff
def create_img_file(x_size, y_size, dtype, file_format, img_fname, intensity_range=None):
if intensity_range is None:
bit_width = int(''.join(filter(str.isdigit, dtype)))
else:
bit_width = round(math.log(intensity_ran... | true | true |
1c2fd45f0ec11984bef0ea3fcbfb99c970afdb9e | 11,684 | py | Python | client/modules/Calendar.py | archeltaneka/jasper-finalproject | 88151554f0ced1e7e8c592584ccfe1b79493b71f | [
"MIT"
] | 3 | 2019-05-29T15:21:53.000Z | 2022-01-19T12:48:47.000Z | client/modules/Calendar.py | archeltaneka/jasper-finalproject | 88151554f0ced1e7e8c592584ccfe1b79493b71f | [
"MIT"
] | null | null | null | client/modules/Calendar.py | archeltaneka/jasper-finalproject | 88151554f0ced1e7e8c592584ccfe1b79493b71f | [
"MIT"
] | 2 | 2018-09-24T12:54:38.000Z | 2018-10-02T15:04:39.000Z | import httplib2
import sys
import datetime
import re
import gflags
import calendar
import jasperpath
import logging
import requests
from client.app_utils import getTimezone
from dateutil import tz
from dateutil import parser
from dateutil.relativedelta import relativedelta
from apiclient.discovery import build
from oa... | 43.114391 | 176 | 0.676566 | import httplib2
import sys
import datetime
import re
import gflags
import calendar
import jasperpath
import logging
import requests
from client.app_utils import getTimezone
from dateutil import tz
from dateutil import parser
from dateutil.relativedelta import relativedelta
from apiclient.discovery import build
from oa... | true | true |
1c2fd5f5966cf7d51a1860d24e47594d7de8d44f | 6,104 | py | Python | tests/unit/modules/test_drbd.py | ifraixedes/saltstack-salt | b54becb8b43cc9b7c00b2c0bc637ac534dc62896 | [
"Apache-2.0"
] | 9,425 | 2015-01-01T05:59:24.000Z | 2022-03-31T20:44:05.000Z | tests/unit/modules/test_drbd.py | ifraixedes/saltstack-salt | b54becb8b43cc9b7c00b2c0bc637ac534dc62896 | [
"Apache-2.0"
] | 33,507 | 2015-01-01T00:19:56.000Z | 2022-03-31T23:48:20.000Z | tests/unit/modules/test_drbd.py | ifraixedes/saltstack-salt | b54becb8b43cc9b7c00b2c0bc637ac534dc62896 | [
"Apache-2.0"
] | 5,810 | 2015-01-01T19:11:45.000Z | 2022-03-31T02:37:20.000Z | """
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
"""
import salt.modules.drbd as drbd
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, patch
from tests.support.unit import TestCase
class DrbdTestCase(TestCase, LoaderModuleMockMixin):
"""
Test cases f... | 31.791667 | 89 | 0.422182 |
import salt.modules.drbd as drbd
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, patch
from tests.support.unit import TestCase
class DrbdTestCase(TestCase, LoaderModuleMockMixin):
def setup_loader_modules(self):
return {drbd: {}}
def test_over... | true | true |
1c2fd66b33bfdead4ee11a93556cf890ac8cb385 | 214 | py | Python | peruintercorp/peruintercorp/doctype/proyectos/test_proyectos.py | aaguirrek/pii-peruintercorp | 027d4c5f1fb79a1b16937bcf0938c4739f26b52a | [
"MIT"
] | null | null | null | peruintercorp/peruintercorp/doctype/proyectos/test_proyectos.py | aaguirrek/pii-peruintercorp | 027d4c5f1fb79a1b16937bcf0938c4739f26b52a | [
"MIT"
] | null | null | null | peruintercorp/peruintercorp/doctype/proyectos/test_proyectos.py | aaguirrek/pii-peruintercorp | 027d4c5f1fb79a1b16937bcf0938c4739f26b52a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Peru Intercorp and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestProyectos(unittest.TestCase):
pass
| 19.454545 | 53 | 0.771028 |
from __future__ import unicode_literals
import frappe
import unittest
class TestProyectos(unittest.TestCase):
pass
| true | true |
1c2fd86a3f1225beeae650437858e61c423f2ef8 | 1,143 | py | Python | test/pyaz/postgres/flexible_server/deploy/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | null | null | null | test/pyaz/postgres/flexible_server/deploy/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | 9 | 2021-09-24T16:37:24.000Z | 2021-12-24T00:39:19.000Z | test/pyaz/postgres/flexible_server/deploy/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | null | null | null | import json, subprocess
from .... pyaz_utils import get_cli_name, get_params
def setup(resource_group, server_name, database_name, admin_user, admin_password, sql_file, repo, action_name=None, branch=None, allow_push=None):
params = get_params(locals())
command = "az postgres flexible-server deploy setup "... | 35.71875 | 146 | 0.682415 | import json, subprocess
from .... pyaz_utils import get_cli_name, get_params
def setup(resource_group, server_name, database_name, admin_user, admin_password, sql_file, repo, action_name=None, branch=None, allow_push=None):
params = get_params(locals())
command = "az postgres flexible-server deploy setup "... | true | true |
1c2fd86c5a584ac6d9a5926e64b58842e9791db0 | 977 | py | Python | general_itests/steps/shared_steps.py | sobolevn/paasta | 8b87e0b13816c09b3d063b6d3271e6c7627fd264 | [
"Apache-2.0"
] | 1,711 | 2015-11-10T18:04:56.000Z | 2022-03-23T08:53:16.000Z | general_itests/steps/shared_steps.py | sobolevn/paasta | 8b87e0b13816c09b3d063b6d3271e6c7627fd264 | [
"Apache-2.0"
] | 1,689 | 2015-11-10T17:59:04.000Z | 2022-03-31T20:46:46.000Z | general_itests/steps/shared_steps.py | sobolevn/paasta | 8b87e0b13816c09b3d063b6d3271e6c7627fd264 | [
"Apache-2.0"
] | 267 | 2015-11-10T19:17:16.000Z | 2022-02-08T20:59:52.000Z | # Copyright 2015-2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 33.689655 | 74 | 0.752303 |
from behave import then
@then('it should have a return code of "{code:d}"')
def see_expected_return_code(context, code):
print(context.output)
print(context.return_code)
print()
assert context.return_code == code
@then('the output should contain "{output_string}"')
def output_contains(c... | true | true |
1c2fd9a22e506269dd9c789c4afcef4614f97997 | 328 | py | Python | test/filter_lol_test.py | zhenggc1/guietta | 2eb78b7d0a30d145a248c6eac27cab2bb907d64c | [
"MIT"
] | 1 | 2020-07-22T17:30:10.000Z | 2020-07-22T17:30:10.000Z | test/filter_lol_test.py | zhenggc1/guietta | 2eb78b7d0a30d145a248c6eac27cab2bb907d64c | [
"MIT"
] | null | null | null | test/filter_lol_test.py | zhenggc1/guietta | 2eb78b7d0a30d145a248c6eac27cab2bb907d64c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
from guietta.guietta import _filter_lol
class FilterLolTest(unittest.TestCase):
def test_filter_lol(self):
lol = [[1, 3, 10], [3.14, 0, -2]]
def func(x):
return x * 2
_filter_lol(lol, func)
assert lol == [[2, 6, 20], [6.28, ... | 17.263158 | 49 | 0.545732 |
import unittest
from guietta.guietta import _filter_lol
class FilterLolTest(unittest.TestCase):
def test_filter_lol(self):
lol = [[1, 3, 10], [3.14, 0, -2]]
def func(x):
return x * 2
_filter_lol(lol, func)
assert lol == [[2, 6, 20], [6.28, 0, -4]]
| true | true |
1c2fda6177765b7906214bb4b8231a55632b2a0e | 22,030 | py | Python | tests/test_s3boto3.py | danielholmes/django-storages | 45d8235ebd62da29bcca6b1e012a143009b2fb0c | [
"BSD-3-Clause"
] | null | null | null | tests/test_s3boto3.py | danielholmes/django-storages | 45d8235ebd62da29bcca6b1e012a143009b2fb0c | [
"BSD-3-Clause"
] | null | null | null | tests/test_s3boto3.py | danielholmes/django-storages | 45d8235ebd62da29bcca6b1e012a143009b2fb0c | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import gzip
import pickle
import threading
import warnings
from datetime import datetime
from unittest import skipIf
from botocore.exceptions import ClientError
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from... | 36.47351 | 111 | 0.607354 |
from __future__ import unicode_literals
import gzip
import pickle
import threading
import warnings
from datetime import datetime
from unittest import skipIf
from botocore.exceptions import ClientError
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.base... | true | true |
1c2fda91b51d903a1fb662774f2ddb659efb16c0 | 3,680 | py | Python | selfdrive/controls/lib/lane_planner.py | azure93/openpilot_079_neokii | 7ac7c327527e8ab7a1b9dc42463ce02be81c444d | [
"MIT"
] | null | null | null | selfdrive/controls/lib/lane_planner.py | azure93/openpilot_079_neokii | 7ac7c327527e8ab7a1b9dc42463ce02be81c444d | [
"MIT"
] | null | null | null | selfdrive/controls/lib/lane_planner.py | azure93/openpilot_079_neokii | 7ac7c327527e8ab7a1b9dc42463ce02be81c444d | [
"MIT"
] | 2 | 2021-05-19T12:34:17.000Z | 2021-06-12T11:32:55.000Z | from common.numpy_fast import interp
import numpy as np
from cereal import log
from selfdrive.ntune import ntune_get
CAMERA_OFFSET = 0.06 # m from center car to camera
def compute_path_pinv(l=50):
deg = 3
x = np.arange(l*1.0)
X = np.vstack(tuple(x**n for n in range(deg, -1, -1))).T
pinv = np.linalg.pinv(X)
... | 33.454545 | 118 | 0.682609 | from common.numpy_fast import interp
import numpy as np
from cereal import log
from selfdrive.ntune import ntune_get
CAMERA_OFFSET = 0.06
def compute_path_pinv(l=50):
deg = 3
x = np.arange(l*1.0)
X = np.vstack(tuple(x**n for n in range(deg, -1, -1))).T
pinv = np.linalg.pinv(X)
return pinv
def model_pol... | true | true |
1c2fdac8dcd7093d69110e668617a1a1d89c8df3 | 1,144 | py | Python | vsphere/objects_queue.py | SumoLogic/sumologic-vmware | 6c19d48b208cec7a69e726dfad0a5e7aa16ad220 | [
"Apache-2.0"
] | 1 | 2022-02-12T02:01:09.000Z | 2022-02-12T02:01:09.000Z | vsphere/objects_queue.py | SumoLogic/sumologic-vmware | 6c19d48b208cec7a69e726dfad0a5e7aa16ad220 | [
"Apache-2.0"
] | null | null | null | vsphere/objects_queue.py | SumoLogic/sumologic-vmware | 6c19d48b208cec7a69e726dfad0a5e7aa16ad220 | [
"Apache-2.0"
] | null | null | null | import threading
class ObjectsQueue:
"""
Implements a queue to store Mor objects of any type for each instance.
"""
def __init__(self):
self._objects_queue = {}
self._objects_queue_lock = threading.RLock()
def fill(self, key, mor_dict):
"""
Set a dict mapping (reso... | 30.105263 | 74 | 0.611014 | import threading
class ObjectsQueue:
def __init__(self):
self._objects_queue = {}
self._objects_queue_lock = threading.RLock()
def fill(self, key, mor_dict):
with self._objects_queue_lock:
self._objects_queue[key] = mor_dict
def contains(self, key):
with self.... | true | true |
1c2fdade7e9808dec5d8d44a9e50dd624d2cefb4 | 1,958 | py | Python | covsirphy/regression/param_decision_tree.py | ardhanii/covid19-sir | 87881963c49a2fc5b6235c8b21269d216acaa941 | [
"Apache-2.0"
] | 97 | 2020-05-15T15:20:15.000Z | 2022-03-18T02:55:54.000Z | covsirphy/regression/param_decision_tree.py | ardhanii/covid19-sir | 87881963c49a2fc5b6235c8b21269d216acaa941 | [
"Apache-2.0"
] | 970 | 2020-06-01T13:48:34.000Z | 2022-03-29T08:20:49.000Z | covsirphy/regression/param_decision_tree.py | ardhani31/Covid19-SIRV-v3 | 59d95156b375c41259c46ce4e656b86903f92ec2 | [
"Apache-2.0"
] | 36 | 2020-05-15T15:36:43.000Z | 2022-02-25T17:59:08.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from sklearn.decomposition import PCA
from sklearn.model_selection import GridSearchCV, TimeSeriesSplit
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import MinMaxScaler
from sklearn.tree import DecisionTreeRegressor
from covsirphy.regression.regbase imp... | 38.392157 | 90 | 0.660368 |
from sklearn.decomposition import PCA
from sklearn.model_selection import GridSearchCV, TimeSeriesSplit
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import MinMaxScaler
from sklearn.tree import DecisionTreeRegressor
from covsirphy.regression.regbase import _RegressorBase
from covsirphy.regression... | true | true |
1c2fdaeab3d1bc770885a1c1c6fb65b25d46fa6d | 29,037 | py | Python | lightbus/transports/redis/event.py | apollo13/lightbus | ad9bb5e376e7aabb400d01307345e00fd07e4677 | [
"Apache-2.0"
] | null | null | null | lightbus/transports/redis/event.py | apollo13/lightbus | ad9bb5e376e7aabb400d01307345e00fd07e4677 | [
"Apache-2.0"
] | null | null | null | lightbus/transports/redis/event.py | apollo13/lightbus | ad9bb5e376e7aabb400d01307345e00fd07e4677 | [
"Apache-2.0"
] | null | null | null | import asyncio
import logging
import time
from collections import OrderedDict
from datetime import datetime
from enum import Enum
from typing import (
Mapping,
Optional,
List,
Tuple,
Union,
Sequence,
AsyncGenerator,
Iterable,
TYPE_CHECKING,
)
from aioredis import ConnectionClosedErr... | 41.719828 | 119 | 0.5431 | import asyncio
import logging
import time
from collections import OrderedDict
from datetime import datetime
from enum import Enum
from typing import (
Mapping,
Optional,
List,
Tuple,
Union,
Sequence,
AsyncGenerator,
Iterable,
TYPE_CHECKING,
)
from aioredis import ConnectionClosedErr... | true | true |
1c2fdb0210a8225d09724a1dc46d1be23dc02305 | 1,206 | py | Python | twkit/__init__.py | evaperon/twAwler | 8e9f2064cad846177ed6547b9f56f053226a2d5e | [
"Apache-2.0"
] | 5 | 2018-12-06T16:14:14.000Z | 2020-05-22T07:36:45.000Z | twkit/__init__.py | evaperon/twAwler | 8e9f2064cad846177ed6547b9f56f053226a2d5e | [
"Apache-2.0"
] | null | null | null | twkit/__init__.py | evaperon/twAwler | 8e9f2064cad846177ed6547b9f56f053226a2d5e | [
"Apache-2.0"
] | 3 | 2020-04-20T07:20:18.000Z | 2021-08-19T17:31:38.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
###########################################
# (c) 2016-2020 Polyvios Pratikakis
# polyvios@ics.forth.gr
###########################################
"""A library for crawling twitter and analyzing crawled tweets and relations.
By Polyvios Pratikakis <polyvios@ics.forth.gr... | 32.594595 | 78 | 0.677446 | true | true | |
1c2fdbc47064bff8c963b841458330ffba157b64 | 273 | py | Python | topCoder/srms/200s/srm209/div2/moving_averages.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-09-30T19:53:08.000Z | 2020-09-30T19:53:08.000Z | topCoder/srms/200s/srm209/div2/moving_averages.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | null | null | null | topCoder/srms/200s/srm209/div2/moving_averages.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-10-15T09:10:57.000Z | 2020-10-15T09:10:57.000Z | class MovingAverages:
def calculate(self, times, n):
def as_second(s):
h, m, s = map(int, s.split(':'))
return h * 3600 + m * 60 + s
s = map(as_second, times)
return map(lambda i: sum(s[i:i+n])/n, xrange(len(times)-n+1))
| 34.125 | 69 | 0.520147 | class MovingAverages:
def calculate(self, times, n):
def as_second(s):
h, m, s = map(int, s.split(':'))
return h * 3600 + m * 60 + s
s = map(as_second, times)
return map(lambda i: sum(s[i:i+n])/n, xrange(len(times)-n+1))
| true | true |
1c2fdca997ee5e21c8c2b73a52a4d7fefbb9bfb2 | 11,938 | py | Python | tests.py | mgax/asyncgen | 78cd6ee413526d4a15ac09632838d3b37d8dd09b | [
"BSD-2-Clause"
] | 1 | 2016-05-08T15:11:01.000Z | 2016-05-08T15:11:01.000Z | tests.py | mgax/asyncgen | 78cd6ee413526d4a15ac09632838d3b37d8dd09b | [
"BSD-2-Clause"
] | null | null | null | tests.py | mgax/asyncgen | 78cd6ee413526d4a15ac09632838d3b37d8dd09b | [
"BSD-2-Clause"
] | null | null | null | import unittest
import cPickle
import asyncgen
from asyncgen import async, generator_map, generator_splitter, async_log
class SimpleCallsTestCase(unittest.TestCase):
"""
Test async calls with no input, only yielding output
"""
def test_one_function(self):
@async
def f():
yi... | 29.994975 | 106 | 0.512565 | import unittest
import cPickle
import asyncgen
from asyncgen import async, generator_map, generator_splitter, async_log
class SimpleCallsTestCase(unittest.TestCase):
"""
Test async calls with no input, only yielding output
"""
def test_one_function(self):
@async
def f():
yi... | false | true |
1c2fdd77a2b8772f3f77fe224a8336b4a07e1707 | 7,571 | py | Python | tests_unit/test__init__.py | daltonmatos/BarterDude | 9f7eb049711d688d61061036e886c33d855e563a | [
"Apache-2.0"
] | 12 | 2020-02-14T20:30:38.000Z | 2022-03-08T17:53:55.000Z | tests_unit/test__init__.py | daltonmatos/BarterDude | 9f7eb049711d688d61061036e886c33d855e563a | [
"Apache-2.0"
] | 11 | 2020-02-29T15:06:25.000Z | 2021-05-03T15:23:12.000Z | tests_unit/test__init__.py | daltonmatos/BarterDude | 9f7eb049711d688d61061036e886c33d855e563a | [
"Apache-2.0"
] | 3 | 2020-02-28T20:43:11.000Z | 2022-02-07T21:56:34.000Z | from asynctest import Mock, TestCase, CoroutineMock, patch, call
from asyncworker import Options, RouteTypes
from barterdude import BarterDude
from barterdude.message import Message
from tests_unit.helpers import load_fixture
class TestBarterDude(TestCase):
@patch("barterdude.App")
@patch("barterdude.AMQPConn... | 37.666667 | 76 | 0.645093 | from asynctest import Mock, TestCase, CoroutineMock, patch, call
from asyncworker import Options, RouteTypes
from barterdude import BarterDude
from barterdude.message import Message
from tests_unit.helpers import load_fixture
class TestBarterDude(TestCase):
@patch("barterdude.App")
@patch("barterdude.AMQPConn... | true | true |
1c2fddcbe5eda8f0b8a7640f59c56bbb9a809a56 | 5,745 | py | Python | RTO_comp/RTO_Bayes_runs.py | OptiMaL-PSE-Lab/Expensive-Black-Box-Optim-ChemEng | 19c34dcff8c983926df501b93152fa3b3b0305d6 | [
"MIT"
] | null | null | null | RTO_comp/RTO_Bayes_runs.py | OptiMaL-PSE-Lab/Expensive-Black-Box-Optim-ChemEng | 19c34dcff8c983926df501b93152fa3b3b0305d6 | [
"MIT"
] | null | null | null | RTO_comp/RTO_Bayes_runs.py | OptiMaL-PSE-Lab/Expensive-Black-Box-Optim-ChemEng | 19c34dcff8c983926df501b93152fa3b3b0305d6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 2 15:49:18 2021
@author: dv516
"""
from algorithms.Bayesian_opt_Pyro.utilities_full import BayesOpt
from case_studies.RTO.systems import *
import numpy as np
import pickle
import pyro
pyro.enable_validation(True) # can help with debugging
def RTO(x):
# x = extr... | 29.921875 | 86 | 0.641775 |
from algorithms.Bayesian_opt_Pyro.utilities_full import BayesOpt
from case_studies.RTO.systems import *
import numpy as np
import pickle
import pyro
pyro.enable_validation(True)
def RTO(x):
plant = WO_system()
f = plant.WO_obj_sys_ca_noise_less
g1 = plant.WO_con1_sys_ca_noise_less
g2 = plan... | true | true |
1c2fde612cc6a5d98b95ea8d9e062970b44ed80e | 198 | py | Python | assignment2/mapper.py | IITDU-BSSE06/ads-demystifying-the-logs-famsagor | 582371d9d51b95e6c14342983219b1b9ba83fd25 | [
"MIT"
] | null | null | null | assignment2/mapper.py | IITDU-BSSE06/ads-demystifying-the-logs-famsagor | 582371d9d51b95e6c14342983219b1b9ba83fd25 | [
"MIT"
] | null | null | null | assignment2/mapper.py | IITDU-BSSE06/ads-demystifying-the-logs-famsagor | 582371d9d51b95e6c14342983219b1b9ba83fd25 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import sys
for line in sys.stdin:
dataSet = line.strip().split(" - - ")
if len(dataSet) == 2:
ipAddress, rest = dataSet
print "{0}\t{1}".format(ipAddress, rest)
| 18 | 43 | 0.60101 |
import sys
for line in sys.stdin:
dataSet = line.strip().split(" - - ")
if len(dataSet) == 2:
ipAddress, rest = dataSet
print "{0}\t{1}".format(ipAddress, rest)
| false | true |
1c2fdebdb580e69cba2adc7acdd3c5b2ac28b500 | 12,914 | py | Python | polus-image-assembler-plugin/src/main.py | blowekamp/polus-plugins | 87f9c36647b4cf95cf107cfede3a5a1d749415a5 | [
"MIT"
] | null | null | null | polus-image-assembler-plugin/src/main.py | blowekamp/polus-plugins | 87f9c36647b4cf95cf107cfede3a5a1d749415a5 | [
"MIT"
] | null | null | null | polus-image-assembler-plugin/src/main.py | blowekamp/polus-plugins | 87f9c36647b4cf95cf107cfede3a5a1d749415a5 | [
"MIT"
] | null | null | null | import argparse, logging, multiprocessing, re
from bfio import BioReader,BioWriter
import numpy as np
from concurrent.futures import ThreadPoolExecutor
from pathlib import Path
STITCH_VARS = ['file','correlation','posX','posY','gridX','gridY'] # image stitching values
STITCH_LINE = "file: {}; corr: {}; position: ({}, ... | 43.92517 | 147 | 0.594471 | import argparse, logging, multiprocessing, re
from bfio import BioReader,BioWriter
import numpy as np
from concurrent.futures import ThreadPoolExecutor
from pathlib import Path
STITCH_VARS = ['file','correlation','posX','posY','gridX','gridY']
STITCH_LINE = "file: {}; corr: {}; position: ({}, {}); grid: ({}, {});\n"
... | true | true |
1c2fdece658ee45e7c59df804f24c5c925f8d7d9 | 17,589 | py | Python | gaia.py | 0x7c2/cpme2 | 09ee443ca7193d1566ae300fc0f9707aa5d042e0 | [
"Apache-2.0"
] | null | null | null | gaia.py | 0x7c2/cpme2 | 09ee443ca7193d1566ae300fc0f9707aa5d042e0 | [
"Apache-2.0"
] | null | null | null | gaia.py | 0x7c2/cpme2 | 09ee443ca7193d1566ae300fc0f9707aa5d042e0 | [
"Apache-2.0"
] | 2 | 2020-12-17T08:11:45.000Z | 2021-02-25T17:25:43.000Z | #
# Copyright 2020 by 0x7c2, Simon Brecht.
# All rights reserved.
# This file is part of the Report/Analytic Tool - CPme,
# and is released under the "Apache License 2.0". Please see the LICENSE
# file that should have been included as part of this package.
#
from templates import check
import func
class check_gaia_... | 30.642857 | 166 | 0.627722 |
from templates import check
import func
class check_gaia_hwinfo(check):
page = "GAiA.0verview"
category = "Appliance"
title = ""
isFirewall = True
isManagement = True
minVersion = 8020
command = "cpstat -f hw_info os"
isCommand = True
def run_check(self):
for line in... | true | true |
1c2fdfdfa6ead222afd8b8eb59e9c9e529e8da83 | 3,000 | py | Python | parton/cli.py | peterstangl/parton | a7adefee7e8372e9b046a51b263d6a06165ff098 | [
"MIT"
] | 5 | 2018-12-25T20:56:32.000Z | 2022-03-22T00:16:38.000Z | parton/cli.py | peterstangl/parton | a7adefee7e8372e9b046a51b263d6a06165ff098 | [
"MIT"
] | 1 | 2022-01-18T07:13:04.000Z | 2022-01-28T05:42:29.000Z | parton/cli.py | peterstangl/parton | a7adefee7e8372e9b046a51b263d6a06165ff098 | [
"MIT"
] | 3 | 2019-09-20T14:52:16.000Z | 2022-03-28T15:27:09.000Z | """Command line interface."""
import argparse
from fnmatch import fnmatch
from . import io
import tarfile
import logging
logging.basicConfig(level=logging.INFO)
def main(argv=None):
parser = argparse.ArgumentParser(prog='parton',
description="Command line interface to downl... | 37.5 | 120 | 0.618 |
import argparse
from fnmatch import fnmatch
from . import io
import tarfile
import logging
logging.basicConfig(level=logging.INFO)
def main(argv=None):
parser = argparse.ArgumentParser(prog='parton',
description="Command line interface to download parton distribution functi... | true | true |
1c2fe051fc50416987d34e6e97aa237660a84ae8 | 5,535 | py | Python | kornia/geometry/epipolar/projection.py | FGeri/kornia | 92fa259601679031dc59c82ffe6862a1b5c8878a | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-06-17T16:57:14.000Z | 2020-06-17T16:57:14.000Z | kornia/geometry/epipolar/projection.py | FGeri/kornia | 92fa259601679031dc59c82ffe6862a1b5c8878a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | kornia/geometry/epipolar/projection.py | FGeri/kornia | 92fa259601679031dc59c82ffe6862a1b5c8878a | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2022-01-26T13:39:34.000Z | 2022-01-26T13:39:34.000Z | """Module for image projections."""
from typing import Union
import torch
from kornia.geometry.epipolar import numeric
def intrinsics_like(focal: float, input: torch.Tensor) -> torch.Tensor:
r"""Returns a 3x3 instrinsics matrix, with same size as the input.
The center of projection will be based in the inp... | 32.946429 | 106 | 0.61897 | from typing import Union
import torch
from kornia.geometry.epipolar import numeric
def intrinsics_like(focal: float, input: torch.Tensor) -> torch.Tensor:
assert len(input.shape) == 4, input.shape
assert focal > 0, focal
B, _, H, W = input.shape
intrinsics = numeric.eye_like(3, input)
intrinsi... | true | true |
1c2fe086337950aa673e79642215c2f1a374b0ea | 30,570 | py | Python | app/grandchallenge/evaluation/migrations/0001_initial.py | kaczmarj/grand-challenge.org | 8dc8a2170e51072354f7e94f2a22578805a67b94 | [
"Apache-2.0"
] | 7 | 2016-11-05T07:16:30.000Z | 2017-11-23T03:38:03.000Z | app/grandchallenge/evaluation/migrations/0001_initial.py | kaczmarj/grand-challenge.org | 8dc8a2170e51072354f7e94f2a22578805a67b94 | [
"Apache-2.0"
] | 113 | 2015-05-26T09:27:59.000Z | 2018-03-21T10:45:56.000Z | app/grandchallenge/evaluation/migrations/0001_initial.py | kaczmarj/grand-challenge.org | 8dc8a2170e51072354f7e94f2a22578805a67b94 | [
"Apache-2.0"
] | 7 | 2015-07-16T20:11:22.000Z | 2017-06-06T02:41:24.000Z | # Generated by Django 3.1.1 on 2020-12-02 13:26
import uuid
from decimal import Decimal
import django.core.validators
import django.db.models.deletion
import django_extensions.db.fields
from django.conf import settings
from django.db import migrations, models
import grandchallenge.components.models
import grandchall... | 43.056338 | 403 | 0.367648 |
import uuid
from decimal import Decimal
import django.core.validators
import django.db.models.deletion
import django_extensions.db.fields
from django.conf import settings
from django.db import migrations, models
import grandchallenge.components.models
import grandchallenge.core.storage
import grandchallenge.core.va... | true | true |
1c2fe087748a1234df572bee756c776a9b182f2d | 363 | py | Python | my_classes/Tuples/.history/name_tuples_20210721190506.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/Tuples/.history/name_tuples_20210721190506.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/Tuples/.history/name_tuples_20210721190506.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """ Tuple as Data Structure
We have see how we interpreted tuples as data structures
The position of the object contained in the tuple gives it meaning
For example, we can represent a 2D coordinate as: (10, 20)
x y
If pt is a position tuple, we can re... | 30.25 | 73 | 0.61708 | true | true | |
1c2fe11c6ac3fa508db890bc4ec79ab09cf86292 | 4,779 | py | Python | Programs/sent_processing/processing_dwe_17.py | mikepackard415/Scientific-Environmental-Discourse | f8d08734f7c2ce98e088479ac7b58c7b348c0401 | [
"MIT"
] | null | null | null | Programs/sent_processing/processing_dwe_17.py | mikepackard415/Scientific-Environmental-Discourse | f8d08734f7c2ce98e088479ac7b58c7b348c0401 | [
"MIT"
] | null | null | null | Programs/sent_processing/processing_dwe_17.py | mikepackard415/Scientific-Environmental-Discourse | f8d08734f7c2ce98e088479ac7b58c7b348c0401 | [
"MIT"
] | null | null | null | import pandas as pd
import ast
import dask.dataframe as dd
from gensim.utils import effective_n_jobs
import spacy
try:
nlp = spacy.load("en")
except OSError:
nlp = spacy.load("en_core_web_sm")
path = 'Environmental-Discourse'
env = pd.read_pickle('../../Data/'+path+'/env_0.pkl')
env = env[env.year == 2017]
de... | 33.41958 | 114 | 0.594267 | import pandas as pd
import ast
import dask.dataframe as dd
from gensim.utils import effective_n_jobs
import spacy
try:
nlp = spacy.load("en")
except OSError:
nlp = spacy.load("en_core_web_sm")
path = 'Environmental-Discourse'
env = pd.read_pickle('../../Data/'+path+'/env_0.pkl')
env = env[env.year == 2017]
de... | true | true |
1c2fe2e453be6b526576ae046a9baaf0afe5582d | 2,990 | py | Python | linter.py | yubchen/SublimeLinter-for-QJS | c386b5ad5de89d7570c9fb29ea2992e95d2f0666 | [
"MIT"
] | null | null | null | linter.py | yubchen/SublimeLinter-for-QJS | c386b5ad5de89d7570c9fb29ea2992e95d2f0666 | [
"MIT"
] | null | null | null | linter.py | yubchen/SublimeLinter-for-QJS | c386b5ad5de89d7570c9fb29ea2992e95d2f0666 | [
"MIT"
] | null | null | null | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by roadhump
# Copyright (c) 2014 roadhump
#
# License: MIT
#
"""This module exports the ESLint plugin class."""
import sublime
import os
import re
import sys
from .lint import NodeLinter
class ESLint(NodeLinter):
... | 30.824742 | 127 | 0.59398 |
import sublime
import os
import re
import sys
from .lint import NodeLinter
class ESLint(NodeLinter):
cwd = os.path.split(os.path.realpath(__file__))[0]
syntax = ('javascript', 'html', 'javascriptnext', 'javascript (babel)', 'javascript (jsx)', 'jsx-real')
npm_name = 'eslint'
cmd = ('node',... | true | true |
1c2fe3e3373768dfde7d9a8b16225d720e95fca2 | 597 | py | Python | var/spack/repos/builtin/packages/pslib/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/pslib/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/pslib/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Pslib(AutotoolsPackage):
"""C-library to create PostScript files on the fly."""
homep... | 31.421053 | 95 | 0.730318 |
from spack import *
class Pslib(AutotoolsPackage):
homepage = "http://pslib.sourceforge.net/"
url = "https://sourceforge.net/projects/pslib/files/pslib/0.4.5/pslib-0.4.5.tar.gz"
version('0.4.5', sha256='7a33928982b281660206bb3749a4a563e3ac987eea64f41696f212df345212be')
depends_on('jpeg')
... | true | true |
1c2fe3faf32bb6c742fd8ded31cfd83c6c15abcb | 20,258 | py | Python | lib/rucio/tests/test_api_external_representation.py | fno2010/rucio | 47e93cfbe5887071c70de4ba815c1bbdddfac2ce | [
"Apache-2.0"
] | null | null | null | lib/rucio/tests/test_api_external_representation.py | fno2010/rucio | 47e93cfbe5887071c70de4ba815c1bbdddfac2ce | [
"Apache-2.0"
] | null | null | null | lib/rucio/tests/test_api_external_representation.py | fno2010/rucio | 47e93cfbe5887071c70de4ba815c1bbdddfac2ce | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright CERN since 2020
#
# 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 ... | 45.626126 | 144 | 0.623655 |
import random
import string
import unittest
from datetime import datetime
from json import loads
import pytest
import rucio.api.account_limit as api_acc_lim
import rucio.api.rse as api_rse
import rucio.core.account_counter as account_counter
from rucio.api.account import add_account, get_account_info, ... | true | true |
1c2fe45d995e3b53e075541991a3ec3d5009d8ad | 439 | py | Python | users_manage_api/urls.py | OscarMCV/prueba_backend | 893d68c0f3d9bb2dc7bea701e50eed44df4df87f | [
"MIT"
] | null | null | null | users_manage_api/urls.py | OscarMCV/prueba_backend | 893d68c0f3d9bb2dc7bea701e50eed44df4df87f | [
"MIT"
] | null | null | null | users_manage_api/urls.py | OscarMCV/prueba_backend | 893d68c0f3d9bb2dc7bea701e50eed44df4df87f | [
"MIT"
] | null | null | null | #Django
from django.urls import path
#Django rest framework
from rest_framework.urlpatterns import format_suffix_patterns
#Views
from users_manage_api import views as user_views
"""In order to handle urls management better, the "views" name has been changed"""
urlpatterns = [
path('login/', user_views.UserAPIView... | 27.4375 | 82 | 0.781321 |
from django.urls import path
from rest_framework.urlpatterns import format_suffix_patterns
from users_manage_api import views as user_views
urlpatterns = [
path('login/', user_views.UserAPIView.as_view()),
path('logon/', user_views.CreateUser.as_view()),
]
urlpatterns = format_suffix_patterns(urlpatterns)... | true | true |
1c2fe5cf35fa1b453b2fe317770a5af30692455d | 486 | py | Python | app/backend/registries/migrations/0013_auto_20180712_2107.py | stephenhillier/gwells | 235d35f1f40dd845f8fecd0d7c3371c4564567c6 | [
"Apache-2.0"
] | null | null | null | app/backend/registries/migrations/0013_auto_20180712_2107.py | stephenhillier/gwells | 235d35f1f40dd845f8fecd0d7c3371c4564567c6 | [
"Apache-2.0"
] | null | null | null | app/backend/registries/migrations/0013_auto_20180712_2107.py | stephenhillier/gwells | 235d35f1f40dd845f8fecd0d7c3371c4564567c6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-07-12 21:07
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('registries', '0012_auto_20180704_2105'),
]
operations = [
migrations.AlterModelOpt... | 24.3 | 100 | 0.654321 |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('registries', '0012_auto_20180704_2105'),
]
operations = [
migrations.AlterModelOptions(
name='registriesapplication',
options={'or... | true | true |
1c2fe5da46fc1a97007e94c18caac7f5fa497b65 | 8,239 | py | Python | tcs_ion_internship.py | sourabhingale/Hadwritten-text-detection-from-image | 9c04fa8336458406b21a2bdb589a5aeb9559263f | [
"Apache-2.0"
] | 1 | 2020-07-21T12:22:42.000Z | 2020-07-21T12:22:42.000Z | tcs_ion_internship.py | sourabhingale/Hadwritten-text-detection-from-image | 9c04fa8336458406b21a2bdb589a5aeb9559263f | [
"Apache-2.0"
] | null | null | null | tcs_ion_internship.py | sourabhingale/Hadwritten-text-detection-from-image | 9c04fa8336458406b21a2bdb589a5aeb9559263f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""TCS_ION_INTERNSHIP.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1WwvLTyBT-FYYiMNRJTsP2iMHEGHF1mAu
##sourabh ingale
Collage name: aissms ioit
topic of project: Detection of handwriten text detection from image
"""
... | 29.320285 | 123 | 0.67666 |
"""TCS_ION_INTERNSHIP.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1WwvLTyBT-FYYiMNRJTsP2iMHEGHF1mAu
##sourabh ingale
Collage name: aissms ioit
topic of project: Detection of handwriten text detection from image
"""
from __future__ import... | false | true |
1c2fe5f15190b2d43bdd5dc69c9fd74b7a7bebe8 | 6,082 | py | Python | owlbot.py | HoangDinhTho/nodejs-firestore | 58ed6d6acff6ebefbd0609257ccf5a78c9dec46c | [
"Apache-2.0"
] | 1 | 2019-10-18T22:44:00.000Z | 2019-10-18T22:44:00.000Z | owlbot.py | renovate-bot/nodejs-firestore | 1dda1bdb53818299fcaefe606d82777ce74dafd2 | [
"Apache-2.0"
] | null | null | null | owlbot.py | renovate-bot/nodejs-firestore | 1dda1bdb53818299fcaefe606d82777ce74dafd2 | [
"Apache-2.0"
] | null | null | null | import synthtool as s
import synthtool.gcp as gcp
import synthtool.languages.node as node
import logging
import os
import subprocess
from pathlib import Path
from synthtool import _tracked_paths
import shutil
logging.basicConfig(level=logging.DEBUG)
staging = Path("owl-bot-staging")
if staging.is_dir():
try:
v1... | 31.350515 | 113 | 0.634988 | import synthtool as s
import synthtool.gcp as gcp
import synthtool.languages.node as node
import logging
import os
import subprocess
from pathlib import Path
from synthtool import _tracked_paths
import shutil
logging.basicConfig(level=logging.DEBUG)
staging = Path("owl-bot-staging")
if staging.is_dir():
try:
v1... | true | true |
1c2fe7bccf9324aea7bb17a9739be1ad6a210a33 | 2,658 | py | Python | servicios_profesionales/photologue_custom/tests.py | acs-um/ServiciosProfesionales | b29d67cda42f3d975a8abaf58203d92c9d1a3f57 | [
"MIT"
] | 1 | 2018-05-24T23:33:02.000Z | 2018-05-24T23:33:02.000Z | servicios_profesionales/photologue_custom/tests.py | acs-um/ServiciosProfesionales | b29d67cda42f3d975a8abaf58203d92c9d1a3f57 | [
"MIT"
] | 22 | 2018-05-07T20:46:27.000Z | 2018-06-10T23:59:49.000Z | servicios_profesionales/photologue_custom/tests.py | acs-um/ServiciosProfesionales | b29d67cda42f3d975a8abaf58203d92c9d1a3f57 | [
"MIT"
] | null | null | null | from django.test import TestCase, RequestFactory
from django.urls import reverse
from django.apps import apps
from .apps import PhotologueCustomConfig
from .form import GalleryExtendedForm
from Categorias.models import Categoria
from .models import GalleryExtended
from usuarios.models import MyUser
from servicios.mode... | 37.43662 | 92 | 0.647856 | from django.test import TestCase, RequestFactory
from django.urls import reverse
from django.apps import apps
from .apps import PhotologueCustomConfig
from .form import GalleryExtendedForm
from Categorias.models import Categoria
from .models import GalleryExtended
from usuarios.models import MyUser
from servicios.mode... | true | true |
1c2fe86730e711e6fb182397ce9e735878b5b04b | 1,670 | py | Python | alipay/aop/api/domain/CloudbusCommonResult.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/CloudbusCommonResult.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/CloudbusCommonResult.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class CloudbusCommonResult(object):
def __init__(self):
self._code = None
self._data = None
self._message = None
@property
def code(self):
return self._code
... | 23.521127 | 65 | 0.534132 |
import json
from alipay.aop.api.constant.ParamConstants import *
class CloudbusCommonResult(object):
def __init__(self):
self._code = None
self._data = None
self._message = None
@property
def code(self):
return self._code
@code.setter
def code(self, value):
... | true | true |
1c2fe965d8089210f836636560e36b0573e31f72 | 6,563 | py | Python | Script/clf_pre_ln_tf.py | ywu94/Tencent-Ads-Algo-Comp-2020 | 8f008fc1cc21c832e6bdb76056d12ad357da5475 | [
"MIT"
] | 27 | 2020-06-09T18:33:45.000Z | 2021-11-15T11:49:54.000Z | Script/clf_pre_ln_tf.py | Wannaman/Tencent-Ads-Algo-Comp-2020 | 8f008fc1cc21c832e6bdb76056d12ad357da5475 | [
"MIT"
] | 2 | 2020-06-21T01:58:56.000Z | 2020-11-12T18:12:40.000Z | Script/clf_pre_ln_tf.py | Wannaman/Tencent-Ads-Algo-Comp-2020 | 8f008fc1cc21c832e6bdb76056d12ad357da5475 | [
"MIT"
] | 15 | 2020-06-07T14:19:57.000Z | 2020-07-16T08:27:42.000Z | import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
from torch.nn.init import xavier_uniform_, kaiming_normal_
class Pre_LN_Transformer_Encoder_Layer(nn.Module):
"""
Encoder layer for Pre-LN Transformer
"""
def __init__(self, d_model, n_head, intermediate_size=2048, device=None, dr... | 45.576389 | 186 | 0.689928 | import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
from torch.nn.init import xavier_uniform_, kaiming_normal_
class Pre_LN_Transformer_Encoder_Layer(nn.Module):
def __init__(self, d_model, n_head, intermediate_size=2048, device=None, dropout=0.1, **kwargs):
super(Pre_LN_Transformer... | true | true |
1c2fe96ba751a5bd946a6277f0b8f492d52c2402 | 2,126 | py | Python | src/openvino_dnn_detector.py | FenixFly/UNN_HPC_SCHOOL_2019_OPENVINO | 5e5ce1fa14d56549c7809d1a24bc03353ffadcbb | [
"Apache-2.0"
] | null | null | null | src/openvino_dnn_detector.py | FenixFly/UNN_HPC_SCHOOL_2019_OPENVINO | 5e5ce1fa14d56549c7809d1a24bc03353ffadcbb | [
"Apache-2.0"
] | 2 | 2019-11-12T09:03:18.000Z | 2019-11-18T18:19:56.000Z | src/openvino_dnn_detector.py | FenixFly/UNN_HPC_SCHOOL_2019_OPENVINO | 5e5ce1fa14d56549c7809d1a24bc03353ffadcbb | [
"Apache-2.0"
] | null | null | null | import cv2
import numpy
from openvino.inference_engine import IENetwork, IECore
class OpenvinoDnnDetector:
def __init__(self, weightsPath=None, configPath=None,
task_type=None, cpu_extension = None):
self.weights = weightsPath
self.config = configPath
self.task_type = task_... | 40.113208 | 81 | 0.557855 | import cv2
import numpy
from openvino.inference_engine import IENetwork, IECore
class OpenvinoDnnDetector:
def __init__(self, weightsPath=None, configPath=None,
task_type=None, cpu_extension = None):
self.weights = weightsPath
self.config = configPath
self.task_type = task_... | true | true |
1c2fe973c5f524536ba18e5ee4f9dbd3bd74c8da | 800 | py | Python | pong/RandomUtils.py | FireFlyForLife/Python-Pong | bb0c7e2173f87a379fc5426c2ab24df859238ace | [
"MIT"
] | null | null | null | pong/RandomUtils.py | FireFlyForLife/Python-Pong | bb0c7e2173f87a379fc5426c2ab24df859238ace | [
"MIT"
] | null | null | null | pong/RandomUtils.py | FireFlyForLife/Python-Pong | bb0c7e2173f87a379fc5426c2ab24df859238ace | [
"MIT"
] | null | null | null | def randomRanges(ranges):
index = int( random(len(ranges)) )
val = random(float(ranges[index][0]), float(ranges[index][1]))
return val
lastTime = 0
def deltaTime():
global lastTime
delta = millis() - lastTime
lastTime = millis()
return delta
#http://stackoverflow.com/questions/401847/circl... | 33.333333 | 92 | 0.6775 | def randomRanges(ranges):
index = int( random(len(ranges)) )
val = random(float(ranges[index][0]), float(ranges[index][1]))
return val
lastTime = 0
def deltaTime():
global lastTime
delta = millis() - lastTime
lastTime = millis()
return delta
def intersects(ball, platform):
closestX = ... | true | true |
1c2fe9c8f31aa841529840a16b5969ee18f61dd2 | 1,522 | py | Python | CreateNetworks.py | yukimasano/nw_SEIR | af9d1298861eba8aadd1517a92e176f76a7218a2 | [
"MIT"
] | 7 | 2019-02-13T18:04:34.000Z | 2021-01-17T15:49:40.000Z | CreateNetworks.py | yukimasano/nw_SEIR | af9d1298861eba8aadd1517a92e176f76a7218a2 | [
"MIT"
] | 2 | 2017-11-15T21:52:33.000Z | 2020-02-10T08:33:25.000Z | CreateNetworks.py | yukimasano/nw_SEIR | af9d1298861eba8aadd1517a92e176f76a7218a2 | [
"MIT"
] | 5 | 2019-05-05T01:38:48.000Z | 2020-04-03T08:32:48.000Z | # -*- coding: utf-8 -*-
"""
CreateNetworks.py
This algorithm aggregates the temporally resolved network data
default= 20min aggregation, by setting mins=1/3 we get 20sec resolution.
Output: Tensor A20 for day 1, tensor B20 for day 2 along with the the times as vectors.
@author:
Yuki M. Asano
"""
import numpy as np
... | 29.843137 | 87 | 0.639947 |
import numpy as np
def createnw(data,metadata,mins):
tt=-1
maxtime=np.ceil((data[-1,0] - data[0,0] )/(20*3*mins))
numIndividuals=len(metadata[:, 0])
startid=int(metadata[0][0])
A= np.zeros((numchildren+1,numIndividuals+1, maxtime+1),dtype=np.int)
told=0
for row in range(len(data[:,0... | true | true |
1c2fea21b8f9ccc7b4e55871b2cc9d33d28e9fd9 | 1,619 | py | Python | t.py | lucascbarbosa/real-pokedex | 1c0dc26fa6a923db5d7f525c303d85644f632ccd | [
"MIT"
] | null | null | null | t.py | lucascbarbosa/real-pokedex | 1c0dc26fa6a923db5d7f525c303d85644f632ccd | [
"MIT"
] | null | null | null | t.py | lucascbarbosa/real-pokedex | 1c0dc26fa6a923db5d7f525c303d85644f632ccd | [
"MIT"
] | null | null | null | a = ['Abra', 'Aerodactyl', 'Alakazam', 'Arbok', 'Arcanine', 'Articuno', 'Beedrill', 'Bellsprout', 'Blastoise', 'bulbasaur', 'Butterfree', 'Caterpie', 'Chansey', 'Charizard', 'Charmander', 'Charmeleon', 'Clefable', 'Clefairy', 'Cloyster', 'Cubone', 'desktop.ini', 'Dewgong', 'Diglett', 'Ditto', 'Dodrio', 'Doduo', 'Dragon... | 539.666667 | 928 | 0.644225 | a = ['Abra', 'Aerodactyl', 'Alakazam', 'Arbok', 'Arcanine', 'Articuno', 'Beedrill', 'Bellsprout', 'Blastoise', 'bulbasaur', 'Butterfree', 'Caterpie', 'Chansey', 'Charizard', 'Charmander', 'Charmeleon', 'Clefable', 'Clefairy', 'Cloyster', 'Cubone', 'desktop.ini', 'Dewgong', 'Diglett', 'Ditto', 'Dodrio', 'Doduo', 'Dragon... | true | true |
1c2fec35942e7d1eb8b16707c437ec0877f05d70 | 17,276 | py | Python | py-polars/tests/test_datelike.py | tamasfe/polars | 709b8d57e32f61c57191cb8ab435a200e3ae6df7 | [
"MIT"
] | 3 | 2022-03-06T12:45:47.000Z | 2022-03-26T08:43:31.000Z | py-polars/tests/test_datelike.py | webclinic017/polars | 5d342a6474754e47baa4f10d64201a4ae015e6c7 | [
"MIT"
] | null | null | null | py-polars/tests/test_datelike.py | webclinic017/polars | 5d342a6474754e47baa4f10d64201a4ae015e6c7 | [
"MIT"
] | null | null | null | import io
from datetime import date, datetime, timedelta
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
from test_series import verify_series_and_expr_api
import polars as pl
def test_fill_null() -> None:
dt = datetime.strptime("2021-01-01", "%Y-%m-%d")
s = pl.Series("A", [dt, Non... | 30.415493 | 88 | 0.522054 | import io
from datetime import date, datetime, timedelta
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
from test_series import verify_series_and_expr_api
import polars as pl
def test_fill_null() -> None:
dt = datetime.strptime("2021-01-01", "%Y-%m-%d")
s = pl.Series("A", [dt, Non... | true | true |
1c2fecc3e4fcae7bb5d8e4e51a3b7a4a48038d87 | 9,247 | py | Python | networkx/algorithms/tests/test_clique.py | AaronOpfer/networkx | f04ca835c3503f04f9b3e933270575980e44205b | [
"BSD-3-Clause"
] | 1 | 2020-05-13T01:08:42.000Z | 2020-05-13T01:08:42.000Z | networkx/algorithms/tests/test_clique.py | AaronOpfer/networkx | f04ca835c3503f04f9b3e933270575980e44205b | [
"BSD-3-Clause"
] | 1 | 2019-11-28T21:08:50.000Z | 2019-11-28T21:08:50.000Z | networkx/algorithms/tests/test_clique.py | AaronOpfer/networkx | f04ca835c3503f04f9b3e933270575980e44205b | [
"BSD-3-Clause"
] | 1 | 2021-01-27T12:09:05.000Z | 2021-01-27T12:09:05.000Z | #!/usr/bin/env python
from nose.tools import *
import networkx as nx
from networkx import convert_node_labels_to_integers as cnlti
class TestCliques:
def setUp(self):
z = [3, 4, 3, 4, 2, 4, 2, 1, 1, 1, 1]
self.G = cnlti(nx.generators.havel_hakimi_graph(z), first_label=1)
self.cl = list(nx... | 42.810185 | 95 | 0.43798 |
from nose.tools import *
import networkx as nx
from networkx import convert_node_labels_to_integers as cnlti
class TestCliques:
def setUp(self):
z = [3, 4, 3, 4, 2, 4, 2, 1, 1, 1, 1]
self.G = cnlti(nx.generators.havel_hakimi_graph(z), first_label=1)
self.cl = list(nx.find_cliques(self.G)... | true | true |
1c2feccef9baf99c4cf758dcacd8533f5c4d54ca | 747 | py | Python | gsextract/gsextract.py | ssloxford/gsextract | f892161767f994f291ffd13a45417dfe7184d409 | [
"Unlicense"
] | 35 | 2020-09-30T11:18:13.000Z | 2022-03-20T13:05:24.000Z | gsextract/gsextract.py | ssloxford/gsextract | f892161767f994f291ffd13a45417dfe7184d409 | [
"Unlicense"
] | 2 | 2020-11-30T22:06:58.000Z | 2021-01-01T15:19:43.000Z | gsextract/gsextract.py | ssloxford/gsextract | f892161767f994f291ffd13a45417dfe7184d409 | [
"Unlicense"
] | 4 | 2020-11-19T22:20:25.000Z | 2021-10-09T01:34:58.000Z | import click
import gsextract.gse_parser as gse_parser
@click.command()
@click.argument('input_file', type=click.Path(exists=True))
@click.argument('output_file', type=click.Path())
@click.option('--stream/--no-stream', default=False, help='Stream continuously from the file. Use the --stream flag to dump to a pcap fro... | 57.461538 | 206 | 0.768407 | import click
import gsextract.gse_parser as gse_parser
@click.command()
@click.argument('input_file', type=click.Path(exists=True))
@click.argument('output_file', type=click.Path())
@click.option('--stream/--no-stream', default=False, help='Stream continuously from the file. Use the --stream flag to dump to a pcap fro... | true | true |
1c2fed3ccbdce6442d7a0f5d1ce30c9fad72def6 | 728 | py | Python | fcuser/admin.py | hwanseok-dev/the-fast | 089952047f7228385e655153c094d0fce9c5e1da | [
"MIT"
] | null | null | null | fcuser/admin.py | hwanseok-dev/the-fast | 089952047f7228385e655153c094d0fce9c5e1da | [
"MIT"
] | null | null | null | fcuser/admin.py | hwanseok-dev/the-fast | 089952047f7228385e655153c094d0fce9c5e1da | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Fcuser
class FcuserAdmin(admin.ModelAdmin):
list_display = ('email', 'password')
def changelist_view(self, request, extra_context=None):
extra_context = {'title': '사용자 목록'}
return super().changelist_view(request, extra_context)
def cha... | 34.666667 | 88 | 0.723901 | from django.contrib import admin
from .models import Fcuser
class FcuserAdmin(admin.ModelAdmin):
list_display = ('email', 'password')
def changelist_view(self, request, extra_context=None):
extra_context = {'title': '사용자 목록'}
return super().changelist_view(request, extra_context)
def cha... | true | true |
1c2fed7afd2f122fb62bb2d4f069b59c2f3a2420 | 4,225 | py | Python | yatube/yatube/settings.py | Andrey11995/yatube_project | 5f053803e6deb42f1e75e69ecb3d2b94cbb255e5 | [
"MIT"
] | null | null | null | yatube/yatube/settings.py | Andrey11995/yatube_project | 5f053803e6deb42f1e75e69ecb3d2b94cbb255e5 | [
"MIT"
] | null | null | null | yatube/yatube/settings.py | Andrey11995/yatube_project | 5f053803e6deb42f1e75e69ecb3d2b94cbb255e5 | [
"MIT"
] | null | null | null | """
Django settings for yatube project.
Generated by 'django-admin startproject' using Django 2.2.19.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
#... | 25.299401 | 91 | 0.692308 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'c+utti0k^6xo3=@hpoehw_%jteq#492km*@k-h6q6qci+()c96'
DEBUG = True
ALLOWED_HOSTS = [
'localhost',
'127.0.0.1',
'[::1]',
'testserver',
'www.andrey11995.pythonanywhere.com',
'andrey11995.python... | true | true |
1c2fee1ff86668a2fd7b4d181ef083791a47ddcd | 6,726 | py | Python | modulo_ht_validate_transform/ht_validate_transform/src/datasets_collections_files/metadata.py | regulondbunam/3RegulonDB-Santana | 7a9076ea3b4a26dc5445f4ac181bc26993d9ec1c | [
"MIT"
] | null | null | null | modulo_ht_validate_transform/ht_validate_transform/src/datasets_collections_files/metadata.py | regulondbunam/3RegulonDB-Santana | 7a9076ea3b4a26dc5445f4ac181bc26993d9ec1c | [
"MIT"
] | null | null | null | modulo_ht_validate_transform/ht_validate_transform/src/datasets_collections_files/metadata.py | regulondbunam/3RegulonDB-Santana | 7a9076ea3b4a26dc5445f4ac181bc26993d9ec1c | [
"MIT"
] | null | null | null | import pandas as pd
import json
'''#
# name: Metadata.py Version [1.0]
Clase que se encargara de recibir un dataframe con datos del metadata y se encargara
de manipularlos y poder crear un dataframe con los datos del metadadata estructurados como
se requieren.
```python
program_name [options list] arguments
```
##... | 28.5 | 113 | 0.666667 | import pandas as pd
import json
class Metadata():
DATASET_TITLE = "#DATASET TITLE"
PMID = "#PMID:"
CORRESPONDING_AUTHOR = "#CORRESPONDING AUTHOR (EMAIL):"
STRAIN = "#STRAIN:"
REFERENCE_GENOME = "#REFERENCE GENOME:"
DATASET_ACCESION_NUMBER = "#DATASET ACCESION NUMBER[DATABASE]:"
EXPERIME... | true | true |
1c2fee415938db09e076fa4c0900a5cb1d183bbb | 34 | py | Python | 5.py | eliascmaciiel/Exercicios_LP_1B | f56d49cde772bbc3fe9e205693fbe2c5612eae49 | [
"MIT"
] | null | null | null | 5.py | eliascmaciiel/Exercicios_LP_1B | f56d49cde772bbc3fe9e205693fbe2c5612eae49 | [
"MIT"
] | null | null | null | 5.py | eliascmaciiel/Exercicios_LP_1B | f56d49cde772bbc3fe9e205693fbe2c5612eae49 | [
"MIT"
] | null | null | null | digitado = input("Digite algo.")
| 11.333333 | 32 | 0.676471 | digitado = input("Digite algo.")
| true | true |
1c2feeb3159d965187d6337fb06614b6aae8cdef | 1,355 | py | Python | runtime/image_classification/models/vgg16/gpus=16_straight/stage8.py | NestLakerJasonLIN/pipedream | f50827f2e28cbdbd82a4ea686c0498272b1460d6 | [
"MIT"
] | 273 | 2019-08-31T14:12:11.000Z | 2022-03-05T13:34:25.000Z | runtime/image_classification/models/vgg16/gpus=16_straight/stage8.py | albertsh10/pipedream | cad624f79a71f44ba79099f0c38321347b13e5c2 | [
"MIT"
] | 67 | 2019-09-19T15:36:59.000Z | 2022-01-13T09:11:54.000Z | runtime/image_classification/models/vgg16/gpus=16_straight/stage8.py | albertsh10/pipedream | cad624f79a71f44ba79099f0c38321347b13e5c2 | [
"MIT"
] | 100 | 2019-09-16T20:59:14.000Z | 2022-03-23T12:56:56.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import torch
class Stage8(torch.nn.Module):
def __init__(self):
super(Stage8, self).__init__()
self.layer1 = torch.nn.ReLU(inplace=True)
self.layer2 = torch.nn.MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1... | 37.638889 | 105 | 0.597048 |
import torch
class Stage8(torch.nn.Module):
def __init__(self):
super(Stage8, self).__init__()
self.layer1 = torch.nn.ReLU(inplace=True)
self.layer2 = torch.nn.MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
self.layer3 = torch.nn.Conv2d(128, 256, kern... | true | true |
1c2ff0b065e5812246df47b329a55dd1d2ed290d | 1,912 | py | Python | data_api.py | samarthbhargav/pytorch-vision-language | 625e35c2e1945afa89108e20596664d66198ce5b | [
"MIT"
] | 1 | 2020-11-19T08:32:06.000Z | 2020-11-19T08:32:06.000Z | data_api.py | samarthbhargav/pytorch-vision-language | 625e35c2e1945afa89108e20596664d66198ce5b | [
"MIT"
] | 1 | 2018-06-21T13:15:37.000Z | 2018-06-21T13:15:37.000Z | data_api.py | samarthbhargav/pytorch-vision-language | 625e35c2e1945afa89108e20596664d66198ce5b | [
"MIT"
] | null | null | null | import sys, os
import codecs
import json
import pickle as pkl
from collections import defaultdict
import random
class DataApi:
# TODO figure out how to do this for test images
def __init__(self, location="data/cub/"):
self.description_test = self.get_descriptions(
os.path.join(location, "d... | 30.349206 | 84 | 0.566946 | import sys, os
import codecs
import json
import pickle as pkl
from collections import defaultdict
import random
class DataApi:
def __init__(self, location="data/cub/"):
self.description_test = self.get_descriptions(
os.path.join(location, "descriptions_bird.test.fg.json")
)
... | true | true |
1c2ff0d6e6322701a08acaff4002e86c28914868 | 186 | py | Python | frappe/patches/v5_0/modify_session.py | Nxweb-in/frappe | 56b3eb52bf56dd71bee29fde3ed28ed9c6d15947 | [
"MIT"
] | 1 | 2021-06-03T07:04:48.000Z | 2021-06-03T07:04:48.000Z | frappe/patches/v5_0/modify_session.py | Nxweb-in/frappe | 56b3eb52bf56dd71bee29fde3ed28ed9c6d15947 | [
"MIT"
] | null | null | null | frappe/patches/v5_0/modify_session.py | Nxweb-in/frappe | 56b3eb52bf56dd71bee29fde3ed28ed9c6d15947 | [
"MIT"
] | null | null | null |
import frappe
def execute():
if "device" not in frappe.db.get_table_columns("Sessions"):
frappe.db.sql("alter table tabSessions add column `device` varchar(255) default 'desktop'")
| 26.571429 | 93 | 0.747312 |
import frappe
def execute():
if "device" not in frappe.db.get_table_columns("Sessions"):
frappe.db.sql("alter table tabSessions add column `device` varchar(255) default 'desktop'")
| true | true |
1c2ff16dc0a9ea7d6cbb9998061deb5a9dd4016c | 1,713 | py | Python | txtformat.py | hojel/epubia | 6637eb3215544fea2893386ff2bf165fbe1bdf11 | [
"MIT"
] | 2 | 2015-12-30T08:56:21.000Z | 2020-08-27T05:23:00.000Z | txtformat.py | hojel/epubia | 6637eb3215544fea2893386ff2bf165fbe1bdf11 | [
"MIT"
] | 2 | 2015-12-27T12:58:26.000Z | 2016-08-31T00:39:49.000Z | txtformat.py | hojel/epubia | 6637eb3215544fea2893386ff2bf165fbe1bdf11 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
# Plain Text to Formatted Text
import codecs
def guess_coding(txt, filename=''):
if filename.find('.utf8') > 0:
return 'utf-8'
if filename.find('.cp949') > 0:
return 'cp949'
if filename.find('.euckr') > 0:
return 'euc-kr'
if filename.find('... | 30.589286 | 114 | 0.587274 |
import codecs
def guess_coding(txt, filename=''):
if filename.find('.utf8') > 0:
return 'utf-8'
if filename.find('.cp949') > 0:
return 'cp949'
if filename.find('.euckr') > 0:
return 'euc-kr'
if filename.find('.johab') > 0:
return 'johab'
if txt[:3] == ... | false | true |
1c2ff1812d83c0c212d78f3ce04388489258502c | 34,819 | py | Python | unittests/test_pipeline.py | FrancisCrickInstitute/reframe | aec9ab794342de3f813c6e540d978e9a8d0e9e0a | [
"BSD-3-Clause"
] | null | null | null | unittests/test_pipeline.py | FrancisCrickInstitute/reframe | aec9ab794342de3f813c6e540d978e9a8d0e9e0a | [
"BSD-3-Clause"
] | null | null | null | unittests/test_pipeline.py | FrancisCrickInstitute/reframe | aec9ab794342de3f813c6e540d978e9a8d0e9e0a | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016-2020 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
import os
import pathlib
import pytest
import re
import reframe as rfm
import reframe.core.runtime as rt
import reframe.utili... | 31.827239 | 79 | 0.616502 |
import os
import pathlib
import pytest
import re
import reframe as rfm
import reframe.core.runtime as rt
import reframe.utility.os_ext as os_ext
import reframe.utility.sanity as sn
import unittests.fixtures as fixtures
from reframe.core.exceptions import (BuildError, PipelineError, ReframeError,
... | true | true |
1c2ff2f8bc879c16f78556a674ed8c6aeb2eef07 | 27,688 | py | Python | analysis.py | ElectronicNose/Electronic-Nose | 3e79711a7701d352ef5c1c2151c535c5b576b71e | [
"MIT"
] | 1 | 2019-10-08T05:12:52.000Z | 2019-10-08T05:12:52.000Z | analysis.py | ElectronicNose/Electronic-Nose | 3e79711a7701d352ef5c1c2151c535c5b576b71e | [
"MIT"
] | null | null | null | analysis.py | ElectronicNose/Electronic-Nose | 3e79711a7701d352ef5c1c2151c535c5b576b71e | [
"MIT"
] | null | null | null | #analysis files
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QFileDialog
from analysis_gui import Ui_Analysis
import numpy as np
import matplotlib,math,csv
matplotlib.use('Qt5Agg')
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backen... | 44.3008 | 436 | 0.556992 |
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QFileDialog
from analysis_gui import Ui_Analysis
import numpy as np
import matplotlib,math,csv
matplotlib.use('Qt5Agg')
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt5ag... | true | true |
1c2ff38c1946798381749e366e028267adeefd55 | 2,459 | py | Python | batch_script/Bootstrap_Energy.py | DavidAce/2Component_GL | b0821956ebe1d65355b2afd954b099ed18b9ad54 | [
"MIT"
] | null | null | null | batch_script/Bootstrap_Energy.py | DavidAce/2Component_GL | b0821956ebe1d65355b2afd954b099ed18b9ad54 | [
"MIT"
] | null | null | null | batch_script/Bootstrap_Energy.py | DavidAce/2Component_GL | b0821956ebe1d65355b2afd954b099ed18b9ad54 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import sys
import os
import math
from statsmodels.graphics.tsaplots import plot_acf
import statsmodels.api as sm
from statsmodels.tsa.stattools import acf
import scipy.integrate as integrate
import random
import h5py
beta_low=float... | 26.44086 | 127 | 0.629118 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import sys
import os
import math
from statsmodels.graphics.tsaplots import plot_acf
import statsmodels.api as sm
from statsmodels.tsa.stattools import acf
import scipy.integrate as integrate
import random
import h5py
beta_low=float... | true | true |
1c2ff3c29461205a7f9fc39f271e6cb0d572c236 | 1,774 | py | Python | fedrec/utilities/registry.py | ruchirgarg05/RecoEdge | 5986af75bcd97087662ff4b1927925f7afb05ee1 | [
"Apache-2.0"
] | 68 | 2021-06-20T07:54:48.000Z | 2022-02-19T16:11:01.000Z | fedrec/utilities/registry.py | ruchirgarg05/RecoEdge | 5986af75bcd97087662ff4b1927925f7afb05ee1 | [
"Apache-2.0"
] | 100 | 2021-06-24T13:33:24.000Z | 2022-02-23T10:30:27.000Z | fedrec/utilities/registry.py | ruchirgarg05/RecoEdge | 5986af75bcd97087662ff4b1927925f7afb05ee1 | [
"Apache-2.0"
] | 38 | 2021-07-13T12:16:24.000Z | 2022-02-26T05:08:28.000Z | import collections
import collections.abc
import inspect
import sys
LOOKUP_DICT = collections.defaultdict(dict)
def load(kind, name):
registry = LOOKUP_DICT[kind]
def decorator(obj):
if name in registry:
raise LookupError('{} already present'.format(name, kind))
registry[name] = ... | 28.15873 | 72 | 0.619504 | import collections
import collections.abc
import inspect
import sys
LOOKUP_DICT = collections.defaultdict(dict)
def load(kind, name):
registry = LOOKUP_DICT[kind]
def decorator(obj):
if name in registry:
raise LookupError('{} already present'.format(name, kind))
registry[name] = ... | true | true |
1c2ff4247fcd37d7a23fe72dfd5f9801afa595fa | 19,358 | py | Python | src/model.py | GuillaumeAI/gia-style-transfer-tf2 | 543e4e3434b87612bff6bb901c6ce4026069fa15 | [
"MIT"
] | 16 | 2019-05-21T22:28:30.000Z | 2022-03-07T19:29:08.000Z | src/model.py | GuillaumeAI/gia-style-transfer-tf2 | 543e4e3434b87612bff6bb901c6ce4026069fa15 | [
"MIT"
] | 4 | 2021-09-01T07:23:48.000Z | 2022-02-26T12:15:40.000Z | src/model.py | GuillaumeAI/gia-style-transfer-tf2 | 543e4e3434b87612bff6bb901c6ce4026069fa15 | [
"MIT"
] | 5 | 2020-02-08T10:08:58.000Z | 2021-06-03T17:47:32.000Z | from absl import logging, flags
import tensorflow as tf
from tensorflow import keras
from tensorflow.python.keras.utils import tf_utils
# Define model flags
FLAGS = flags.FLAGS
flags.DEFINE_enum("increase_size_layer_type", "default", ["default", "unpool", "deconv"],
"Type of layer to use in the deco... | 40.839662 | 171 | 0.667218 | from absl import logging, flags
import tensorflow as tf
from tensorflow import keras
from tensorflow.python.keras.utils import tf_utils
FLAGS = flags.FLAGS
flags.DEFINE_enum("increase_size_layer_type", "default", ["default", "unpool", "deconv"],
"Type of layer to use in the decoder part. Default us... | true | true |
1c2ff4a9a8a5c5b42363d7b52e47f2bf3c5fb502 | 2,127 | py | Python | chatter/core.py | ii-Python/Chatter-Server-Beta | 24ea0e5946259d659a13d1e53a0220340fcbd7e3 | [
"MIT"
] | null | null | null | chatter/core.py | ii-Python/Chatter-Server-Beta | 24ea0e5946259d659a13d1e53a0220340fcbd7e3 | [
"MIT"
] | null | null | null | chatter/core.py | ii-Python/Chatter-Server-Beta | 24ea0e5946259d659a13d1e53a0220340fcbd7e3 | [
"MIT"
] | null | null | null | # Modules
import socket
from .colors import colored
from .logging import verbose
from .config import load_config
from .client import ClientManager
# Initialization
__version__ = "1.0.32"
__author__ = "Benjamin O'Brien (iiPython)"
# Master class
class ChatterServer(object):
def __init__(self, args):
sel... | 24.170455 | 136 | 0.615421 |
import socket
from .colors import colored
from .logging import verbose
from .config import load_config
from .client import ClientManager
__version__ = "1.0.32"
__author__ = "Benjamin O'Brien (iiPython)"
# Master class
class ChatterServer(object):
def __init__(self, args):
self.args = args
sel... | true | true |
1c2ff4dbfd802e4d4eba5c4159798b8dbab43d7d | 1,175 | py | Python | maximum_effort/urls.py | PaulBowden673/Projects-MP-MP4 | a4a176457560e6d5087c823f86da0a88f2ad6537 | [
"W3C",
"PostgreSQL"
] | null | null | null | maximum_effort/urls.py | PaulBowden673/Projects-MP-MP4 | a4a176457560e6d5087c823f86da0a88f2ad6537 | [
"W3C",
"PostgreSQL"
] | null | null | null | maximum_effort/urls.py | PaulBowden673/Projects-MP-MP4 | a4a176457560e6d5087c823f86da0a88f2ad6537 | [
"W3C",
"PostgreSQL"
] | null | null | null | """maximum_effort URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Clas... | 37.903226 | 77 | 0.702128 | from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('accounts/', include('allauth.urls')),
path('', include('home.urls')),
path('products/', include('pro... | true | true |
1c2ff5ae08e63595101cfc142c33334519f8fd9f | 907 | py | Python | tsx/examples/rocket_native_guide.py | MatthiasJakobs/tsx | 8a686ffd0af2f9f826d9ce11349e0fa0e883e897 | [
"MIT"
] | null | null | null | tsx/examples/rocket_native_guide.py | MatthiasJakobs/tsx | 8a686ffd0af2f9f826d9ce11349e0fa0e883e897 | [
"MIT"
] | null | null | null | tsx/examples/rocket_native_guide.py | MatthiasJakobs/tsx | 8a686ffd0af2f9f826d9ce11349e0fa0e883e897 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import matplotlib.pyplot as plt
from tsx.models.classifier import ROCKET
from tsx.datasets import load_itapowdem
from tsx.counterfactuals import NativeGuide
ds = load_itapowdem()
x_train, y_train = ds.torch(train=True)
x_test, y_test = ds.torch(train=False)
model = ROCKET(input_length=... | 30.233333 | 97 | 0.743109 | import numpy as np
import torch
import matplotlib.pyplot as plt
from tsx.models.classifier import ROCKET
from tsx.datasets import load_itapowdem
from tsx.counterfactuals import NativeGuide
ds = load_itapowdem()
x_train, y_train = ds.torch(train=True)
x_test, y_test = ds.torch(train=False)
model = ROCKET(input_length=... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.