max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
utils/nlp.py | splovyt/SFPython-Project-Night | 1 | 6500 | import ssl
import nltk
from textblob import TextBlob
from nltk.corpus import stopwords
# set SSL
try:
_create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
pass
else:
ssl._create_default_https_context = _create_unverified_https_context
# download noun data (if required... | import ssl
import nltk
from textblob import TextBlob
from nltk.corpus import stopwords
# set SSL
try:
_create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
pass
else:
ssl._create_default_https_context = _create_unverified_https_context
# download noun data (if required... | en | 0.838924 | # set SSL # download noun data (if required) Extract the nouns from a sentence using the 'textblob' library. Remove stopwords from a sentence and return the list of words. | 3.373053 | 3 |
toolbox/core/management/commands/celery_beat_resource_scraper.py | akshedu/toolbox | 0 | 6501 |
from django_celery_beat.models import PeriodicTask, IntervalSchedule
from django.core.management.base import BaseCommand
from django.db import IntegrityError
class Command(BaseCommand):
def handle(self, *args, **options):
try:
schedule_channel, created = IntervalSchedule.objects.get_or_create... |
from django_celery_beat.models import PeriodicTask, IntervalSchedule
from django.core.management.base import BaseCommand
from django.db import IntegrityError
class Command(BaseCommand):
def handle(self, *args, **options):
try:
schedule_channel, created = IntervalSchedule.objects.get_or_create... | none | 1 | 2.214904 | 2 | |
ppcls/data/preprocess/__init__.py | zhusonghe/PaddleClas-1 | 3,763 | 6502 | <filename>ppcls/data/preprocess/__init__.py
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licen... | <filename>ppcls/data/preprocess/__init__.py
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licen... | en | 0.789978 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli... | 1.420305 | 1 |
src/scalar_net/visualisations.py | scheeloong/lindaedynamics_icml2018 | 1 | 6503 | # required modules
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib import cm
from matplotlib.colors import Normalize
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.animation import FuncAnimation
# two-dimesional version
def plot_mse_loss_surface_2d(fi... | # required modules
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib import cm
from matplotlib.colors import Normalize
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.animation import FuncAnimation
# two-dimesional version
def plot_mse_loss_surface_2d(fi... | en | 0.524606 | # required modules # two-dimesional version # create weight space # weight 1 # weight 2 # initialize cost matrix # Fill the cost matrix for each combination of weights # compute gradients # plot vector space # fig, ax = plt.subplots(figsize=(8, 8)) #ax.contour(ws_x, ws_y, cost_ws, 200) # ax.set(aspect=1, title='Loss Su... | 2.583677 | 3 |
tests/qconvolutional_test.py | kshithijiyer/qkeras | 0 | 6504 | # Copyright 2019 Google LLC
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | # Copyright 2019 Google LLC
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | en | 0.793936 | # Copyright 2019 Google LLC # # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,... | 1.71869 | 2 |
discord/ext/ui/select.py | Lapis256/discord-ext-ui | 0 | 6505 | from typing import Optional, List, TypeVar, Generic, Callable
import discord.ui
from .item import Item
from .select_option import SelectOption
from .custom import CustomSelect
def _default_check(_: discord.Interaction) -> bool:
return True
C = TypeVar("C", bound=discord.ui.Select)
class Select(Item, Generic... | from typing import Optional, List, TypeVar, Generic, Callable
import discord.ui
from .item import Item
from .select_option import SelectOption
from .custom import CustomSelect
def _default_check(_: discord.Interaction) -> bool:
return True
C = TypeVar("C", bound=discord.ui.Select)
class Select(Item, Generic... | none | 1 | 2.436419 | 2 | |
ucscsdk/mometa/storage/StorageScsiLunRef.py | parag-may4/ucscsdk | 9 | 6506 | """This module contains the general information for StorageScsiLunRef ManagedObject."""
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class StorageScsiLunRefConsts():
pass
class StorageScsiLunRef(ManagedObject):
"""Th... | """This module contains the general information for StorageScsiLunRef ManagedObject."""
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class StorageScsiLunRefConsts():
pass
class StorageScsiLunRef(ManagedObject):
"""Th... | en | 0.550567 | This module contains the general information for StorageScsiLunRef ManagedObject. This is StorageScsiLunRef class. ((deleteAll|ignore|deleteNonPresent),){0,2}(deleteAll|ignore|deleteNonPresent){0,1} [\-\.:_a-zA-Z0-9]{0,16} ((removed|created|modified|deleted),){0,3}(removed|created|modified|deleted){0,1} | 1.986726 | 2 |
saxstools/fullsaxs.py | latrocinia/saxstools | 0 | 6507 | <filename>saxstools/fullsaxs.py
from __future__ import print_function, absolute_import, division
from sys import stdout as _stdout
from time import time as _time
import numpy as np
try:
import pyfftw
pyfftw.interfaces.cache.enable()
pyfftw.interfaces.cache.set_keepalive_time(10)
rfftn = pyfftw.interfa... | <filename>saxstools/fullsaxs.py
from __future__ import print_function, absolute_import, division
from sys import stdout as _stdout
from time import time as _time
import numpy as np
try:
import pyfftw
pyfftw.interfaces.cache.enable()
pyfftw.interfaces.cache.set_keepalive_time(10)
rfftn = pyfftw.interfa... | en | 0.799307 | # parameters to be defined # parameters with standard values # CPU or GPU # unchangeable # check if requirements are set # determine size for grid # calculate the interaction surface and core of the receptor # keep track of some data for later calculations # set ligand center to the origin of the receptor map # and mak... | 1.780396 | 2 |
lib/generate_random_obs.py | zehuilu/Learning-from-Sparse-Demonstrations | 8 | 6508 | #!/usr/bin/env python3
import os
import sys
import time
sys.path.append(os.getcwd()+'/lib')
import random
from dataclasses import dataclass, field
from ObsInfo import ObsInfo
def generate_random_obs(num_obs: int, size_list: list, config_data):
"""
config_file_name = "config.json"
json_file = open(config_f... | #!/usr/bin/env python3
import os
import sys
import time
sys.path.append(os.getcwd()+'/lib')
import random
from dataclasses import dataclass, field
from ObsInfo import ObsInfo
def generate_random_obs(num_obs: int, size_list: list, config_data):
"""
config_file_name = "config.json"
json_file = open(config_f... | en | 0.322448 | #!/usr/bin/env python3 config_file_name = "config.json" json_file = open(config_file_name) config_data = json.load(json_file) size_list = [length, width, height] # random center | 2.542641 | 3 |
userbot/helper_funcs/misc.py | Abucuyy/Uciha | 0 | 6509 | <filename>userbot/helper_funcs/misc.py
# TG-UserBot - A modular Telegram UserBot script for Python.
# Copyright (C) 2019 Kandarp <https://github.com/kandnub>
#
# TG-UserBot is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Sof... | <filename>userbot/helper_funcs/misc.py
# TG-UserBot - A modular Telegram UserBot script for Python.
# Copyright (C) 2019 Kandarp <https://github.com/kandnub>
#
# TG-UserBot is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Sof... | en | 0.85332 | # TG-UserBot - A modular Telegram UserBot script for Python. # Copyright (C) 2019 Kandarp <https://github.com/kandnub> # # TG-UserBot is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Li... | 2.133794 | 2 |
gym-multilayerthinfilm/utils.py | HarryTheBird/gym-multilayerthinfilm | 10 | 6510 | <filename>gym-multilayerthinfilm/utils.py
import numpy as np
def get_n_from_txt(filepath, points=None, lambda_min=400, lambda_max=700, complex_n=True):
ntxt = np.loadtxt(filepath)
if np.min(np.abs(ntxt[:, 0] - lambda_min)) > 25 or np.min(np.abs(ntxt[:, 0] - lambda_max)) > 25:
print('No measurement data... | <filename>gym-multilayerthinfilm/utils.py
import numpy as np
def get_n_from_txt(filepath, points=None, lambda_min=400, lambda_max=700, complex_n=True):
ntxt = np.loadtxt(filepath)
if np.min(np.abs(ntxt[:, 0] - lambda_min)) > 25 or np.min(np.abs(ntxt[:, 0] - lambda_max)) > 25:
print('No measurement data... | none | 1 | 2.424088 | 2 | |
pyrocco/__init__.py | joaopalmeiro/pyrocco | 0 | 6511 | __package_name__ = "pyrocco"
__version__ = "0.1.0"
__author__ = "<NAME>"
__author_email__ = "<EMAIL>"
__description__ = "A Python CLI to add the Party Parrot to a custom background image."
__url__ = "https://github.com/joaopalmeiro/pyrocco"
| __package_name__ = "pyrocco"
__version__ = "0.1.0"
__author__ = "<NAME>"
__author_email__ = "<EMAIL>"
__description__ = "A Python CLI to add the Party Parrot to a custom background image."
__url__ = "https://github.com/joaopalmeiro/pyrocco"
| none | 1 | 1.019152 | 1 | |
2020/day08/machine.py | ingjrs01/adventofcode | 0 | 6512 | <reponame>ingjrs01/adventofcode<gh_stars>0
class Machine():
def __init__(self):
self.pointer = 0
self.accum = 0
self.visited = []
def run(self,program):
salir = False
while (salir == False):
if (self.pointer in self.visited):
return False... | class Machine():
def __init__(self):
self.pointer = 0
self.accum = 0
self.visited = []
def run(self,program):
salir = False
while (salir == False):
if (self.pointer in self.visited):
return False
if (self.pointer >= len(progr... | none | 1 | 3.434645 | 3 | |
EduData/Task/__init__.py | BAOOOOOM/EduData | 98 | 6513 | # coding: utf-8
# 2019/8/23 @ tongshiwei
| # coding: utf-8
# 2019/8/23 @ tongshiwei
| en | 0.789204 | # coding: utf-8 # 2019/8/23 @ tongshiwei | 0.821458 | 1 |
010-round.py | richardvecsey/python-basics | 3 | 6514 | <filename>010-round.py
"""
Round a number
--------------
Input (float) A floating point number
(int) Number of decimals
Default value is: 0
Output (float) Rounded number
(int) Whether using the default decimals value, the return number
... | <filename>010-round.py
"""
Round a number
--------------
Input (float) A floating point number
(int) Number of decimals
Default value is: 0
Output (float) Rounded number
(int) Whether using the default decimals value, the return number
... | en | 0.56135 | Round a number
--------------
Input (float) A floating point number
(int) Number of decimals
Default value is: 0
Output (float) Rounded number
(int) Whether using the default decimals value, the return number
will be the nearest integ... | 4.437328 | 4 |
service.py | Kleist/MusicPlayer | 1 | 6515 | <filename>service.py
#!/usr/bin/env python3
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522
import play
import time
class TagPlayer(object):
def __init__(self):
self._current = None
self.reader = SimpleMFRC522()
self._failed = 0
def step(self):
id, text = self.read... | <filename>service.py
#!/usr/bin/env python3
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522
import play
import time
class TagPlayer(object):
def __init__(self):
self._current = None
self.reader = SimpleMFRC522()
self._failed = 0
def step(self):
id, text = self.read... | fr | 0.221828 | #!/usr/bin/env python3 | 2.897197 | 3 |
mypy/defaults.py | ckanesan/mypy | 0 | 6516 | <gh_stars>0
import os
MYPY = False
if MYPY:
from typing_extensions import Final
PYTHON2_VERSION = (2, 7) # type: Final
PYTHON3_VERSION = (3, 6) # type: Final
PYTHON3_VERSION_MIN = (3, 4) # type: Final
CACHE_DIR = '.mypy_cache' # type: Final
CONFIG_FILE = 'mypy.ini' # type: Final
SHARED_CONFIG_FILES = ['setup... | import os
MYPY = False
if MYPY:
from typing_extensions import Final
PYTHON2_VERSION = (2, 7) # type: Final
PYTHON3_VERSION = (3, 6) # type: Final
PYTHON3_VERSION_MIN = (3, 4) # type: Final
CACHE_DIR = '.mypy_cache' # type: Final
CONFIG_FILE = 'mypy.ini' # type: Final
SHARED_CONFIG_FILES = ['setup.cfg', ] # ... | en | 0.758436 | # type: Final # type: Final # type: Final # type: Final # type: Final # type: Final # type: Final # type: Final # This must include all reporters defined in mypy.report. This is defined here # to make reporter names available without importing mypy.report -- this speeds # up startup. # type: Final | 1.849946 | 2 |
skcriteria/preprocessing/push_negatives.py | elcolie/scikit-criteria | 0 | 6517 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# License: BSD-3 (https://tldrlegal.com/license/bsd-3-clause-license-(revised))
# Copyright (c) 2016-2021, <NAME>; Luczywo, Nadia
# All rights reserved.
# =============================================================================
# DOCS
# ===============================... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# License: BSD-3 (https://tldrlegal.com/license/bsd-3-clause-license-(revised))
# Copyright (c) 2016-2021, <NAME>; Luczywo, Nadia
# All rights reserved.
# =============================================================================
# DOCS
# ===============================... | en | 0.521594 | #!/usr/bin/env python # -*- coding: utf-8 -*- # License: BSD-3 (https://tldrlegal.com/license/bsd-3-clause-license-(revised)) # Copyright (c) 2016-2021, <NAME>; Luczywo, Nadia # All rights reserved. # ============================================================================= # DOCS # ================================... | 2.036634 | 2 |
ingenico/direct/sdk/domain/customer_token.py | Ingenico/direct-sdk-python3 | 0 | 6518 | # -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://support.direct.ingenico.com/documentation/api/reference/
#
from ingenico.direct.sdk.data_object import DataObject
from ingenico.direct.sdk.domain.address import Address
from ingenico.direct.sdk.domain.company_informatio... | # -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://support.direct.ingenico.com/documentation/api/reference/
#
from ingenico.direct.sdk.data_object import DataObject
from ingenico.direct.sdk.domain.address import Address
from ingenico.direct.sdk.domain.company_informatio... | en | 0.618049 | # -*- coding: utf-8 -*- # # This class was auto-generated from the API references found at # https://support.direct.ingenico.com/documentation/api/reference/ # | Object containing billing address details Type: :class:`ingenico.direct.sdk.domain.address.Address` | Object containing company information ... | 2.262081 | 2 |
inserter.py | pirate/macOS-global-autocomplete | 23 | 6519 | import time
import pykeyboard
# TODO: Replace following two lines with the code that activate the application.
print('Activate the application 3 seconds.')
time.sleep(3)
k = pykeyboard.PyKeyboard()
k.press_key(k.left_key)
time.sleep(1) # Hold down left key for 1 second.
k.release_key(k.left_key)
| import time
import pykeyboard
# TODO: Replace following two lines with the code that activate the application.
print('Activate the application 3 seconds.')
time.sleep(3)
k = pykeyboard.PyKeyboard()
k.press_key(k.left_key)
time.sleep(1) # Hold down left key for 1 second.
k.release_key(k.left_key)
| en | 0.843866 | # TODO: Replace following two lines with the code that activate the application. # Hold down left key for 1 second. | 3.000639 | 3 |
tools/corpora.py | EleutherAI/megatron-3d | 3 | 6520 | import os
import tarfile
from abc import ABC, abstractmethod
from glob import glob
import shutil
import random
import zstandard
"""
This registry is for automatically downloading and extracting datasets.
To register a class you need to inherit the DataDownloader class, provide name, filetype and url attributes, and
(... | import os
import tarfile
from abc import ABC, abstractmethod
from glob import glob
import shutil
import random
import zstandard
"""
This registry is for automatically downloading and extracting datasets.
To register a class you need to inherit the DataDownloader class, provide name, filetype and url attributes, and
(... | en | 0.719776 | This registry is for automatically downloading and extracting datasets. To register a class you need to inherit the DataDownloader class, provide name, filetype and url attributes, and (optionally) provide download / extract / exists / tokenize functions to check if the data exists, and, if it doesn't, download, extr... | 3.342479 | 3 |
othello_rl/qlearning/qlearning.py | aka256/othello-rl | 0 | 6521 | <filename>othello_rl/qlearning/qlearning.py
from logging import getLogger
logger = getLogger(__name__)
class QLearning:
"""
Q-Learning用のクラス
Attributes
----------
alpha : float
学習率α
gamma : float
割引率γ
data : dict
Q-Learningでの学習結果の保存用辞書
init_value : float
dataの初期値
"""
def __init__(s... | <filename>othello_rl/qlearning/qlearning.py
from logging import getLogger
logger = getLogger(__name__)
class QLearning:
"""
Q-Learning用のクラス
Attributes
----------
alpha : float
学習率α
gamma : float
割引率γ
data : dict
Q-Learningでの学習結果の保存用辞書
init_value : float
dataの初期値
"""
def __init__(s... | ja | 0.404729 | Q-Learning用のクラス Attributes ---------- alpha : float 学習率α gamma : float 割引率γ data : dict Q-Learningでの学習結果の保存用辞書 init_value : float dataの初期値 dataから値の取得 Parameters ---------- s : int 状態 a : int 行動 Returns ------- value : float Q値, Q(s, a) dataへの値... | 3.107172 | 3 |
SearchService/test/unit/test_solr_interface.py | loftwah/appscale | 790 | 6522 | <gh_stars>100-1000
#!/usr/bin/env python
import os
import json
import sys
import unittest
import urllib2
from flexmock import flexmock
sys.path.append(os.path.join(os.path.dirname(__file__), "../../"))
import solr_interface
import search_exceptions
class FakeSolrDoc():
def __init__(self):
self.fields = []
cl... | #!/usr/bin/env python
import os
import json
import sys
import unittest
import urllib2
from flexmock import flexmock
sys.path.append(os.path.join(os.path.dirname(__file__), "../../"))
import solr_interface
import search_exceptions
class FakeSolrDoc():
def __init__(self):
self.fields = []
class FakeDocument():... | en | 0.455164 | #!/usr/bin/env python A set of test cases for the solr interface module. # Test the case of ValueError on a json.load. # Test a bad status from SOLR. | 2.591907 | 3 |
payabbhi/error.py | ppm-avinder/payabbhi-python | 1 | 6523 | class PayabbhiError(Exception):
def __init__(self, description=None, http_status=None,
field=None):
self.description = description
self.http_status = http_status
self.field = field
self._message = self.error_message()
super(PayabbhiError, self).__init__(self... | class PayabbhiError(Exception):
def __init__(self, description=None, http_status=None,
field=None):
self.description = description
self.http_status = http_status
self.field = field
self._message = self.error_message()
super(PayabbhiError, self).__init__(self... | none | 1 | 2.753103 | 3 | |
src/mpu/__init__.py | TsinghuaAI/CPM-2-Pretrain | 54 | 6524 | # coding=utf-8
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | # coding=utf-8
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | en | 0.857982 | # coding=utf-8 # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re... | 1.179238 | 1 |
djangosige/apps/cadastro/models/empresa.py | MateusMolina/lunoERP | 0 | 6525 | # -*- coding: utf-8 -*-
import os
from django.db import models
from django.db.models.signals import post_delete
from django.dispatch import receiver
from .base import Pessoa
from djangosige.apps.login.models import Usuario
from djangosige.configs.settings import MEDIA_ROOT
def logo_directory_path(inst... | # -*- coding: utf-8 -*-
import os
from django.db import models
from django.db.models.signals import post_delete
from django.dispatch import receiver
from .base import Pessoa
from djangosige.apps.login.models import Usuario
from djangosige.configs.settings import MEDIA_ROOT
def logo_directory_path(inst... | pt | 0.717402 | # -*- coding: utf-8 -*- # Deletar logo se ja existir um # Deletar logo quando empresa for deletada # Nao deletar a imagem default 'logo.png' | 1.886304 | 2 |
WDJN/eval/eval.py | silverriver/Stylized_Dialog | 21 | 6526 | import os
from nltk.translate.bleu_score import corpus_bleu
from nltk.translate.bleu_score import SmoothingFunction
import json
from tqdm import tqdm, trange
from random import sample
import numpy as np
import pickle
import argparse
import bert_eval_acc
import svm_eval_acc
smooth = SmoothingFunction()
def eval_bleu... | import os
from nltk.translate.bleu_score import corpus_bleu
from nltk.translate.bleu_score import SmoothingFunction
import json
from tqdm import tqdm, trange
from random import sample
import numpy as np
import pickle
import argparse
import bert_eval_acc
import svm_eval_acc
smooth = SmoothingFunction()
def eval_bleu... | en | 0.614602 | :param ref: list(list(list(any))), a list of reference sentences, each element of the list is a list of references :param pred: list(list(any)), a list of predictions :return: corpus bleu score :param ref: list(list(list(any))), a list of reference sentences, each element of the list is a list of references ... | 2.766604 | 3 |
homeassistant/components/unifi/const.py | olbjan/home-assistant-1 | 7 | 6527 | """Constants for the UniFi component."""
import logging
LOGGER = logging.getLogger(__package__)
DOMAIN = "unifi"
CONTROLLER_ID = "{host}-{site}"
CONF_CONTROLLER = "controller"
CONF_SITE_ID = "site"
UNIFI_WIRELESS_CLIENTS = "unifi_wireless_clients"
CONF_ALLOW_BANDWIDTH_SENSORS = "allow_bandwidth_sensors"
CONF_BLOCK... | """Constants for the UniFi component."""
import logging
LOGGER = logging.getLogger(__package__)
DOMAIN = "unifi"
CONTROLLER_ID = "{host}-{site}"
CONF_CONTROLLER = "controller"
CONF_SITE_ID = "site"
UNIFI_WIRELESS_CLIENTS = "unifi_wireless_clients"
CONF_ALLOW_BANDWIDTH_SENSORS = "allow_bandwidth_sensors"
CONF_BLOCK... | en | 0.612256 | Constants for the UniFi component. | 1.782599 | 2 |
coding_intereview/1656. Design an Ordered Stream.py | Jahidul007/Python-Bootcamp | 2 | 6528 | <reponame>Jahidul007/Python-Bootcamp<filename>coding_intereview/1656. Design an Ordered Stream.py
class OrderedStream:
def __init__(self, n: int):
self.data = [None]*n
self.ptr = 0
def insert(self, id: int, value: str) -> List[str]:
id -= 1
self.data[id] = value
if id... | Design an Ordered Stream.py
class OrderedStream:
def __init__(self, n: int):
self.data = [None]*n
self.ptr = 0
def insert(self, id: int, value: str) -> List[str]:
id -= 1
self.data[id] = value
if id > self.ptr: return []
while self.ptr < len(self.dat... | en | 0.775804 | # Your OrderedStream object will be instantiated and called as such: # obj = OrderedStream(n) # param_1 = obj.insert(id,value) | 3.40734 | 3 |
python/test/test_tree_dp.py | EQt/treelas | 3 | 6529 | import numpy as np
from treelas import post_order, TreeInstance
def test_demo_3x7_postord():
parent = np.array([0, 4, 5, 0, 3, 4, 7, 8, 5, 6, 7, 8,
9, 14, 17, 12, 15, 16, 19, 16, 17])
po = post_order(parent, include_root=True)
expect = np.array([12, 11, 19, 20, 21, 14, 15, 18, 17, 1... | import numpy as np
from treelas import post_order, TreeInstance
def test_demo_3x7_postord():
parent = np.array([0, 4, 5, 0, 3, 4, 7, 8, 5, 6, 7, 8,
9, 14, 17, 12, 15, 16, 19, 16, 17])
po = post_order(parent, include_root=True)
expect = np.array([12, 11, 19, 20, 21, 14, 15, 18, 17, 1... | none | 1 | 2.284285 | 2 | |
lista01/rpc/ex01_cl.py | SD-CC-UFG/leonardo.fleury | 0 | 6530 | <reponame>SD-CC-UFG/leonardo.fleury<gh_stars>0
import xmlrpc.client
def main():
s = xmlrpc.client.ServerProxy('http://localhost:9991')
nome = input("Nome: ")
cargo = input("Cargo (programador, operador): ")
salario = float(input("Salário: "))
print("\n\n{}".format(s.atualiza_salario(nome, cargo... | import xmlrpc.client
def main():
s = xmlrpc.client.ServerProxy('http://localhost:9991')
nome = input("Nome: ")
cargo = input("Cargo (programador, operador): ")
salario = float(input("Salário: "))
print("\n\n{}".format(s.atualiza_salario(nome, cargo, salario)))
if __name__ == '__main__':
m... | none | 1 | 3.09319 | 3 | |
autocomplete/migrations/0001_initial.py | openshift-eng/art-dashboard-server | 1 | 6531 | <gh_stars>1-10
# Generated by Django 3.0.7 on 2020-07-27 19:23
import build.models
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='AutoCompleteRecord',
fie... | # Generated by Django 3.0.7 on 2020-07-27 19:23
import build.models
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='AutoCompleteRecord',
fields=[
... | en | 0.815932 | # Generated by Django 3.0.7 on 2020-07-27 19:23 | 1.885447 | 2 |
unet3d/config.py | fcollman/pytorch-3dunet | 0 | 6532 | import argparse
import os
import torch
import yaml
DEFAULT_DEVICE = 'cuda:0'
def load_config():
parser = argparse.ArgumentParser(description='UNet3D training')
parser.add_argument('--config', type=str, help='Path to the YAML config file', required=True)
args = parser.parse_args()
config = _load_conf... | import argparse
import os
import torch
import yaml
DEFAULT_DEVICE = 'cuda:0'
def load_config():
parser = argparse.ArgumentParser(description='UNet3D training')
parser.add_argument('--config', type=str, help='Path to the YAML config file', required=True)
args = parser.parse_args()
config = _load_conf... | en | 0.943213 | # Get a device to train on | 2.576432 | 3 |
src/graph_transpiler/webdnn/backend/webgl/optimize_rules/simplify_channel_mode_conversion/simplify_channel_mode_conversion.py | gunpowder78/webdnn | 1 | 6533 | <filename>src/graph_transpiler/webdnn/backend/webgl/optimize_rules/simplify_channel_mode_conversion/simplify_channel_mode_conversion.py<gh_stars>1-10
from webdnn.backend.webgl.optimize_rules.simplify_channel_mode_conversion.simplify_nonsense_channel_mode_conversion import \
SimplifyNonsenseChannelModeConversion
fro... | <filename>src/graph_transpiler/webdnn/backend/webgl/optimize_rules/simplify_channel_mode_conversion/simplify_channel_mode_conversion.py<gh_stars>1-10
from webdnn.backend.webgl.optimize_rules.simplify_channel_mode_conversion.simplify_nonsense_channel_mode_conversion import \
SimplifyNonsenseChannelModeConversion
fro... | none | 1 | 1.546574 | 2 | |
script.video.F4mProxy/lib/flvlib/constants.py | akuala/REPO.KUALA | 105 | 6534 | <filename>script.video.F4mProxy/lib/flvlib/constants.py
"""
The constants used in FLV files and their meanings.
"""
# Tag type
(TAG_TYPE_AUDIO, TAG_TYPE_VIDEO, TAG_TYPE_SCRIPT) = (8, 9, 18)
# Sound format
(SOUND_FORMAT_PCM_PLATFORM_ENDIAN,
SOUND_FORMAT_ADPCM,
SOUND_FORMAT_MP3,
SOUND_FORMAT_PCM_LITTLE_ENDIAN,
SOU... | <filename>script.video.F4mProxy/lib/flvlib/constants.py
"""
The constants used in FLV files and their meanings.
"""
# Tag type
(TAG_TYPE_AUDIO, TAG_TYPE_VIDEO, TAG_TYPE_SCRIPT) = (8, 9, 18)
# Sound format
(SOUND_FORMAT_PCM_PLATFORM_ENDIAN,
SOUND_FORMAT_ADPCM,
SOUND_FORMAT_MP3,
SOUND_FORMAT_PCM_LITTLE_ENDIAN,
SOU... | en | 0.653339 | The constants used in FLV files and their meanings. # Tag type # Sound format # Sound rate # Sound size # Sound type # AAC packet type # Codec ID # Frame type # H.264 packet type # Value type | 2.093062 | 2 |
A2/semcor_chunk.py | Rogerwlk/Natural-Language-Processing | 0 | 6535 | <filename>A2/semcor_chunk.py
from nltk.corpus import semcor
class semcor_chunk:
def __init__(self, chunk):
self.chunk = chunk
#returns the synset if applicable, otherwise returns None
def get_syn_set(self):
try:
synset = self.chunk.label().synset()
return synset
except AttributeError:
try:
syns... | <filename>A2/semcor_chunk.py
from nltk.corpus import semcor
class semcor_chunk:
def __init__(self, chunk):
self.chunk = chunk
#returns the synset if applicable, otherwise returns None
def get_syn_set(self):
try:
synset = self.chunk.label().synset()
return synset
except AttributeError:
try:
syns... | en | 0.389188 | #returns the synset if applicable, otherwise returns None #returns a list of the words in the chunk # if __name__ == "__main__": # s = semcor.tagged_sents(tag='sem')[0] # for chunk in s: # a = semcor_chunk(chunk) # print a.get_syn_set() # for chunk in s: # a = semcor_chunk(chunk) # print a.get_words() | 3.009669 | 3 |
gnn_model.py | thoang3/graph_neural_network_benchmark | 0 | 6536 | import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from load_cora import load_cora
from baseline_model import create_ffn
from utils import run_experiment
from utils import display_learning_curves
# Graph convolution layer
class GraphConvLayer(layers.Layer):
def __init__(
... | import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from load_cora import load_cora
from baseline_model import create_ffn
from utils import run_experiment
from utils import display_learning_curves
# Graph convolution layer
class GraphConvLayer(layers.Layer):
def __init__(
... | en | 0.727076 | # Graph convolution layer # node_representations shape is [num_edges, embedding_dim] # node_indices shape is [num_edges] # neighbour_messages shape: [num_edges, representation_dim] # node_representations shape is [num_nodes, representation_dim] # aggregated_messages shape is [num_nodes, representation_dim] # Create a s... | 2.537148 | 3 |
deps/lib/python3.5/site-packages/netdisco/discoverables/samsung_tv.py | jfarmer08/hassio | 78 | 6537 | """Discover Samsung Smart TV services."""
from . import SSDPDiscoverable
from ..const import ATTR_NAME
# For some models, Samsung forces a [TV] prefix to the user-specified name.
FORCED_NAME_PREFIX = '[TV]'
class Discoverable(SSDPDiscoverable):
"""Add support for discovering Samsung Smart TV services."""
de... | """Discover Samsung Smart TV services."""
from . import SSDPDiscoverable
from ..const import ATTR_NAME
# For some models, Samsung forces a [TV] prefix to the user-specified name.
FORCED_NAME_PREFIX = '[TV]'
class Discoverable(SSDPDiscoverable):
"""Add support for discovering Samsung Smart TV services."""
de... | en | 0.749641 | Discover Samsung Smart TV services. # For some models, Samsung forces a [TV] prefix to the user-specified name. Add support for discovering Samsung Smart TV services. Get all the Samsung RemoteControlReceiver entries. Get most important info, by default the description location. # Strip the forced prefix, if present | 3.214676 | 3 |
pyecsca/sca/re/__init__.py | scrambler-crypto/pyecsca | 24 | 6538 | <filename>pyecsca/sca/re/__init__.py<gh_stars>10-100
"""Package for reverse-engineering."""
from .rpa import *
| <filename>pyecsca/sca/re/__init__.py<gh_stars>10-100
"""Package for reverse-engineering."""
from .rpa import *
| en | 0.942685 | Package for reverse-engineering. | 1.207699 | 1 |
sapmi/employees/migrations/0002_remove_employee_phone_alt.py | Juhanostby/django-apotek-sapmi | 1 | 6539 | <reponame>Juhanostby/django-apotek-sapmi
# Generated by Django 3.2.5 on 2021-12-21 19:42
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('employees', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='employee',
... | # Generated by Django 3.2.5 on 2021-12-21 19:42
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('employees', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='employee',
name='phone_alt',
),
... | en | 0.877249 | # Generated by Django 3.2.5 on 2021-12-21 19:42 | 1.457218 | 1 |
src/model/exception/emote_fetch_error.py | konrad2508/kokomi-discord-bot | 2 | 6540 | class EmoteFetchError(Exception):
'''Exception stating that there was a problem while fetching emotes from a source.'''
| class EmoteFetchError(Exception):
'''Exception stating that there was a problem while fetching emotes from a source.'''
| en | 0.973875 | Exception stating that there was a problem while fetching emotes from a source. | 2.028875 | 2 |
src/sim/basicExample/main.py | andremtsilva/dissertacao | 0 | 6541 | <gh_stars>0
"""
This is the most simple scenario with a basic topology, some users and a set of apps with only one service.
@author: <NAME>
"""
import os
import time
import json
import random
import logging.config
import networkx as nx
import numpy as np
from pathlib import Path
from yafs.core import Sim
fro... | """
This is the most simple scenario with a basic topology, some users and a set of apps with only one service.
@author: <NAME>
"""
import os
import time
import json
import random
import logging.config
import networkx as nx
import numpy as np
from pathlib import Path
from yafs.core import Sim
from yafs.appli... | en | 0.738046 | This is the most simple scenario with a basic topology, some users and a set of apps with only one service. @author: <NAME> TOPOLOGY # Fix position of nodes for drawing # You also can create a topology using JSONs files. Check out examples folder # In NX-lib there are a lot of Graphs generators # Definition of man... | 2.84774 | 3 |
Backend/models/risklayerPrognosis.py | dbvis-ukon/coronavis | 15 | 6542 | from db import db
class RisklayerPrognosis(db.Model):
__tablename__ = 'risklayer_prognosis'
datenbestand = db.Column(db.TIMESTAMP, primary_key=True, nullable=False)
prognosis = db.Column(db.Float, nullable=False)
# class RisklayerPrognosisSchema(SQLAlchemyAutoSchema):
# class Meta:
# strict ... | from db import db
class RisklayerPrognosis(db.Model):
__tablename__ = 'risklayer_prognosis'
datenbestand = db.Column(db.TIMESTAMP, primary_key=True, nullable=False)
prognosis = db.Column(db.Float, nullable=False)
# class RisklayerPrognosisSchema(SQLAlchemyAutoSchema):
# class Meta:
# strict ... | en | 0.347764 | # class RisklayerPrognosisSchema(SQLAlchemyAutoSchema): # class Meta: # strict = True # model = RisklayerPrognosis # # timestamp = fields.Timestamp(data_key="datenbestand") # prognosis = fields.Number(data_key="prognosis") | 2.362253 | 2 |
tests.py | smartfile/django-secureform | 12 | 6543 | <reponame>smartfile/django-secureform
import os
import unittest
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django
if django.VERSION >= (1, 7):
django.setup()
from django import forms
from django.db import models
from django.forms.forms import NON_FIELD_ERRORS
from django_secureform.forms import Secu... | import os
import unittest
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django
if django.VERSION >= (1, 7):
django.setup()
from django import forms
from django.db import models
from django.forms.forms import NON_FIELD_ERRORS
from django_secureform.forms import SecureForm
def get_form_sname(form, name... | en | 0.765562 | # We must copy over the security data. | 2.668722 | 3 |
opencv/resizing.py | hackerman-101/Hacktoberfest-2022 | 1 | 6544 | <gh_stars>1-10
import cv2 as cv
import numpy as np
cap = cv.VideoCapture(1)
print(cap.get(cv.CAP_PROP_FRAME_WIDTH))
print(cap.get(cv.CAP_PROP_FRAME_HEIGHT))
cap.set(3,3000)
cap.set(4,3000)
print(cap.get(cv.CAP_PROP_FRAME_WIDTH))
print(cap.get(cv.CAP_PROP_FRAME_HEIGHT))
while (cap.isOpened()):
ret , frame = cap... | import cv2 as cv
import numpy as np
cap = cv.VideoCapture(1)
print(cap.get(cv.CAP_PROP_FRAME_WIDTH))
print(cap.get(cv.CAP_PROP_FRAME_HEIGHT))
cap.set(3,3000)
cap.set(4,3000)
print(cap.get(cv.CAP_PROP_FRAME_WIDTH))
print(cap.get(cv.CAP_PROP_FRAME_HEIGHT))
while (cap.isOpened()):
ret , frame = cap.read()
if... | none | 1 | 2.779057 | 3 | |
minibenchmarks/go.py | kevinxucs/pyston | 1 | 6545 | <reponame>kevinxucs/pyston
# from pypy-benchmarks/own/chaos.py, with some minor modifications
# (more output, took out the benchmark harness)
#
import random, math, sys, time
SIZE = 9
GAMES = 200
KOMI = 7.5
EMPTY, WHITE, BLACK = 0, 1, 2
SHOW = {EMPTY: '.', WHITE: 'o', BLACK: 'x'}
PASS = -1
MAXMOVES = SIZE*SIZE*3
TIME... | # from pypy-benchmarks/own/chaos.py, with some minor modifications
# (more output, took out the benchmark harness)
#
import random, math, sys, time
SIZE = 9
GAMES = 200
KOMI = 7.5
EMPTY, WHITE, BLACK = 0, 1, 2
SHOW = {EMPTY: '.', WHITE: 'o', BLACK: 'x'}
PASS = -1
MAXMOVES = SIZE*SIZE*3
TIMESTAMP = 0
MOVES = 0
def to... | en | 0.684814 | # from pypy-benchmarks/own/chaos.py, with some minor modifications # (more output, took out the benchmark harness) # # if color == BLACK: # self.board.black_dead += 1 # else: # self.board.white_dead += 1 #print 'members1', square, root, members1 #print 'ledges1', squa... | 2.762993 | 3 |
tools/gen_usb_descriptor.py | BrianPugh/circuitpython | 1 | 6546 | # SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
#
# SPDX-License-Identifier: MIT
import argparse
import os
import sys
sys.path.append("../../tools/usb_descriptor")
from adafruit_usb_descriptor import audio, audio10, cdc, hid, mi... | # SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
#
# SPDX-License-Identifier: MIT
import argparse
import os
import sys
sys.path.append("../../tools/usb_descriptor")
from adafruit_usb_descriptor import audio, audio10, cdc, hid, mi... | en | 0.680978 | # SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # # SPDX-License-Identifier: MIT # Digitizer works on Linux but conflicts with mouse, so omit it. Assign a monotonically increasing index to each unique string. Start with 0. # langid ... | 2.43728 | 2 |
bclstm/train_meld.py | Columbine21/THUIAR-ERC | 1 | 6547 | from tqdm import tqdm
import pandas as pd
import numpy as np, argparse, time, pickle, random, os, datetime
import torch
import torch.optim as optim
from model import MaskedNLLLoss, BC_LSTM
from dataloader import MELDDataLoader
from sklearn.metrics import f1_score, confusion_matrix, accuracy_score, classification_re... | from tqdm import tqdm
import pandas as pd
import numpy as np, argparse, time, pickle, random, os, datetime
import torch
import torch.optim as optim
from model import MaskedNLLLoss, BC_LSTM
from dataloader import MELDDataLoader
from sklearn.metrics import f1_score, confusion_matrix, accuracy_score, classification_re... | en | 0.57333 | Manually Fix the random seed to get deterministic results. # batch*seq_len, n_classes # batch*seq_len # batch*seq_len # dataloader settings # model settings. # late fusion module. # train settings. # [1, epoches] # [epoches] | 2.178474 | 2 |
bin/p3starcoordcheck.py | emkailu/PAT3DEM | 0 | 6548 | <reponame>emkailu/PAT3DEM
#!/usr/bin/env python
import os
import sys
import argparse
import pat3dem.star as p3s
import math
def main():
progname = os.path.basename(sys.argv[0])
usage = progname + """ [options] <coord star files>
Output the coord star files after deleting duplicate particles
"""
args_def = {'mi... | #!/usr/bin/env python
import os
import sys
import argparse
import pat3dem.star as p3s
import math
def main():
progname = os.path.basename(sys.argv[0])
usage = progname + """ [options] <coord star files>
Output the coord star files after deleting duplicate particles
"""
args_def = {'mindis':150}
parser = argp... | en | 0.360978 | #!/usr/bin/env python [options] <coord star files> Output the coord star files after deleting duplicate particles # get default values # loop over all input files # # use list of list to store x and y # get coord | 2.983696 | 3 |
src/review_scraper.py | ryankirkland/voice-of-the-customer | 0 | 6549 | <filename>src/review_scraper.py
from bs4 import BeautifulSoup
import pandas as pd
import requests
import time
import sys
def reviews_scraper(asin_list, filename):
'''
Takes a list of asins, retrieves html for reviews page, and parses out key data points
Parameters
----------
List of ASINs (list of... | <filename>src/review_scraper.py
from bs4 import BeautifulSoup
import pandas as pd
import requests
import time
import sys
def reviews_scraper(asin_list, filename):
'''
Takes a list of asins, retrieves html for reviews page, and parses out key data points
Parameters
----------
List of ASINs (list of... | en | 0.520143 | Takes a list of asins, retrieves html for reviews page, and parses out key data points Parameters ---------- List of ASINs (list of strings) Returns: ------- review information (list), reviews_df (Pandas DataFrame) # print(d) | 3.199963 | 3 |
lumberdata/metadata.py | cglumberjack/lumber_metadata | 0 | 6550 | # noinspection PyUnresolvedReferences
import os
import re
# TODO I'm going to need to make a dictionary for my big list of stuff i care about and what's needed for
# every file type....
RAF = ['EXIF:LensModel', 'MakerNotes:RawImageHeight', 'MakerNotes:RawImageWidth', 'EXIF:CreateDate', 'EXIF:ModifyDate',
'EXI... | # noinspection PyUnresolvedReferences
import os
import re
# TODO I'm going to need to make a dictionary for my big list of stuff i care about and what's needed for
# every file type....
RAF = ['EXIF:LensModel', 'MakerNotes:RawImageHeight', 'MakerNotes:RawImageWidth', 'EXIF:CreateDate', 'EXIF:ModifyDate',
'EXI... | en | 0.851591 | # noinspection PyUnresolvedReferences # TODO I'm going to need to make a dictionary for my big list of stuff i care about and what's needed for # every file type.... checks if exiftool is installed. :return: checks if redline is installed :return: checks if ffprobe is installed :return: Due to issues with ... | 2.310745 | 2 |
rlbench/task_environment.py | robfiras/RLBench | 0 | 6551 | import logging
from typing import List, Callable
import numpy as np
from pyquaternion import Quaternion
from pyrep import PyRep
from pyrep.errors import IKError
from pyrep.objects import Dummy, Object
from rlbench import utils
from rlbench.action_modes import ArmActionMode, ActionMode
from rlbench.backend.exceptions ... | import logging
from typing import List, Callable
import numpy as np
from pyquaternion import Quaternion
from pyrep import PyRep
from pyrep.errors import IKError
from pyrep.objects import Dummy, Object
from rlbench import utils
from rlbench.action_modes import ArmActionMode, ActionMode
from rlbench.backend.exceptions ... | en | 0.847835 | # redundancy resolution # Returns a list of descriptions and the first observation returns the positions of all graspable object relative to all enabled cameras returns the pose of all graspable object relative to all enabled cameras # Move until reached target joint positions or until we stop moving # (e.g. when we co... | 2.044979 | 2 |
tests/generic_relations/test_forms.py | Yoann-Vie/esgi-hearthstone | 0 | 6552 | from django import forms
from django.contrib.contenttypes.forms import generic_inlineformset_factory
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.test import TestCase
from django.test.utils import isolate_apps
from .models import (
Animal, ForProxyMode... | from django import forms
from django.contrib.contenttypes.forms import generic_inlineformset_factory
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.test import TestCase
from django.test.utils import isolate_apps
from .models import (
Animal, ForProxyMode... | en | 0.327511 | <p><label for="id_generic_relations-taggeditem-content_type-object_id-0-tag">
Tag:</label> <input id="id_generic_relations-taggeditem-content_type-object_id-0-tag" type="text"
name="generic_relations-taggeditem-content_type-object_id-0-tag" maxlength="50"></p>
<p><label for="id_generic_relations-taggeditem-content_t... | 2.022362 | 2 |
src/sage/rings/polynomial/pbori/fglm.py | tamnguyen135/sage | 1 | 6553 | from .PyPolyBoRi import (BooleSet, Polynomial, BoolePolynomialVector,
FGLMStrategy)
def _fglm(I, from_ring, to_ring):
r"""
Unchecked variant of fglm
"""
vec = BoolePolynomialVector(I)
return FGLMStrategy(from_ring, to_ring, vec).main()
def fglm(I, from_ring, to_ring):
... | from .PyPolyBoRi import (BooleSet, Polynomial, BoolePolynomialVector,
FGLMStrategy)
def _fglm(I, from_ring, to_ring):
r"""
Unchecked variant of fglm
"""
vec = BoolePolynomialVector(I)
return FGLMStrategy(from_ring, to_ring, vec).main()
def fglm(I, from_ring, to_ring):
... | en | 0.477916 | Unchecked variant of fglm Convert *reduced* Groebner Basis in from_ring to a GroebnerBasis in to_ring. It acts independent of the global ring, which is restored at the end of the computation. TESTS:: sage: from sage.rings.polynomial.pbori import * sage: from sage.rings.polynomial.... | 2.096431 | 2 |
ferry/embed/umap_reduce.py | coursetable/ferry | 4 | 6554 | <gh_stars>1-10
"""
Uses UMAP (https://umap-learn.readthedocs.io/en/latest/index.html) to reduce course
embeddings to two dimensions for visualization.
"""
import pandas as pd
import umap
from sklearn.preprocessing import StandardScaler
from ferry import config
courses = pd.read_csv(
config.DATA_DIR / "course_embe... | """
Uses UMAP (https://umap-learn.readthedocs.io/en/latest/index.html) to reduce course
embeddings to two dimensions for visualization.
"""
import pandas as pd
import umap
from sklearn.preprocessing import StandardScaler
from ferry import config
courses = pd.read_csv(
config.DATA_DIR / "course_embeddings/courses_... | en | 0.785352 | Uses UMAP (https://umap-learn.readthedocs.io/en/latest/index.html) to reduce course embeddings to two dimensions for visualization. # mypy: ignore-errors | 2.881819 | 3 |
flora_fauna.py | zhumakova/ClassProject | 0 | 6555 | <reponame>zhumakova/ClassProject<filename>flora_fauna.py
import inheritance
class Flora:
def __init__(self, name, lifespan, habitat, plant_type):
self.name = name
self.lifespan = lifespan
self.habitat = habitat
self.plant_type = plant_type
self.plant_size = 0
class Fauna... | import inheritance
class Flora:
def __init__(self, name, lifespan, habitat, plant_type):
self.name = name
self.lifespan = lifespan
self.habitat = habitat
self.plant_type = plant_type
self.plant_size = 0
class Fauna:
def __init__(self, name):
self.name = name... | en | 0.329747 | # def check_planet(self,planet:tsk4.Planet): # if planet.fauna and not planet.humanity: # print('YES') # else: # print('NO') | 3.938808 | 4 |
jug/subcommands/demo.py | rdenham/jug | 309 | 6556 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2017, <NAME> <<EMAIL>>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
#
# 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 ... | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2017, <NAME> <<EMAIL>>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
#
# 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 ... | en | 0.708461 | #!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2017, <NAME> <<EMAIL>> # vim: set ts=4 sts=4 sw=4 expandtab smartindent: # # 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 ... | 2.161701 | 2 |
search/controllers/simple/tests.py | ID2797370/arxiv-search | 35 | 6557 | <reponame>ID2797370/arxiv-search<filename>search/controllers/simple/tests.py
"""Tests for simple search controller, :mod:`search.controllers.simple`."""
from http import HTTPStatus
from unittest import TestCase, mock
from werkzeug.datastructures import MultiDict
from werkzeug.exceptions import InternalServerError, No... | """Tests for simple search controller, :mod:`search.controllers.simple`."""
from http import HTTPStatus
from unittest import TestCase, mock
from werkzeug.datastructures import MultiDict
from werkzeug.exceptions import InternalServerError, NotFound, BadRequest
from search.domain import SimpleQuery
from search.control... | en | 0.833647 | Tests for simple search controller, :mod:`search.controllers.simple`. Tests for :func:`.simple.retrieve_document`. There is a bug in the index or query. Index service raises a IndexConnectionError. # self.assertEqual(code, status.HTTP_500_INTERNAL_SERVER_ERROR) The document is not found. Tests for :func:`.simple.search... | 2.750507 | 3 |
kuri_wandering_robot/scripts/kuri_wandering_robot_executive_node.py | hcrlab/kuri_wandering_robot | 0 | 6558 | #!/usr/bin/env python
# ROS Libraries
import actionlib
from actionlib_msgs.msg import GoalStatus
from control_msgs.msg import JointTrajectoryControllerState, FollowJointTrajectoryAction, FollowJointTrajectoryGoal
from kuri_wandering_robot.msg import Power
from wandering_behavior.msg import WanderAction, WanderGoal
impo... | #!/usr/bin/env python
# ROS Libraries
import actionlib
from actionlib_msgs.msg import GoalStatus
from control_msgs.msg import JointTrajectoryControllerState, FollowJointTrajectoryAction, FollowJointTrajectoryGoal
from kuri_wandering_robot.msg import Power
from wandering_behavior.msg import WanderAction, WanderGoal
impo... | en | 0.886949 | #!/usr/bin/env python # ROS Libraries # Python Default Libraries # Custom Libraries During NORMAL, the base moves according to wandering_behavior. During CHARGING, the robot's eyes are closed and it is charging. The robot transitions from NORMAL to CHARGING if its battery is below a threshold and it is on t... | 2.403237 | 2 |
src/python/nimbusml/internal/entrypoints/trainers_lightgbmbinaryclassifier.py | montehoover/NimbusML | 134 | 6559 | # - Generated by tools/entrypoint_compiler.py: do not edit by hand
"""
Trainers.LightGbmBinaryClassifier
"""
import numbers
from ..utils.entrypoints import EntryPoint
from ..utils.utils import try_set, unlist
def trainers_lightgbmbinaryclassifier(
training_data,
predictor_model=None,
number_... | # - Generated by tools/entrypoint_compiler.py: do not edit by hand
"""
Trainers.LightGbmBinaryClassifier
"""
import numbers
from ..utils.entrypoints import EntryPoint
from ..utils.utils import try_set, unlist
def trainers_lightgbmbinaryclassifier(
training_data,
predictor_model=None,
number_... | en | 0.634376 | # - Generated by tools/entrypoint_compiler.py: do not edit by hand Trainers.LightGbmBinaryClassifier **Description** Train a LightGBM binary classification model. :param number_of_iterations: Number of iterations. (inputs). :param training_data: The data to be used for training (inputs). :param lea... | 2.078803 | 2 |
Job Portal with Automated Resume Screening/gensim-4.1.2/gensim/test/test_rpmodel.py | Candida18/Job-Portal-with-Automated-Resume-Screening | 3 | 6560 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 <NAME> <<EMAIL>>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking transformation algorithms (the models package).
"""
import logging
import unittest
import numpy as np
from gensim.corpora... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 <NAME> <<EMAIL>>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking transformation algorithms (the models package).
"""
import logging
import unittest
import numpy as np
from gensim.corpora... | en | 0.732378 | #!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 <NAME> <<EMAIL>> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html Automated tests for checking transformation algorithms (the models package). # create the transformation model # HACK; set fixed seed so that we always get the... | 2.431046 | 2 |
playground/tianhaoz95/gan_getting_started/cgan_model.py | tianhaoz95/mangekyo | 0 | 6561 | import tensorflow as tf
from tensorflow import keras
class CondGeneratorModel(keras.Model):
def __init__(self):
super(CondGeneratorModel, self).__init__()
# Expand 7*7*128 features into a (7,7,128) tensor
self.dense_1 = keras.layers.Dense(7*7*256)
self.reshape_1 = keras.layers.Resh... | import tensorflow as tf
from tensorflow import keras
class CondGeneratorModel(keras.Model):
def __init__(self):
super(CondGeneratorModel, self).__init__()
# Expand 7*7*128 features into a (7,7,128) tensor
self.dense_1 = keras.layers.Dense(7*7*256)
self.reshape_1 = keras.layers.Resh... | en | 0.78143 | # Expand 7*7*128 features into a (7,7,128) tensor # Expand (10,) to (7,7,1) # From (7,7,256) to (7,7,128) # From (7,7,128) to (14,14,64) # From (14,14,64) to (28,28,1) # Expand label input to be the same as latent feature # Expand features to image channels # Combine latent feature and label input # From (7,7,256) to (... | 2.731209 | 3 |
ahd2fhir/utils/resource_handler.py | miracum/ahd2fhir | 3 | 6562 | <reponame>miracum/ahd2fhir<filename>ahd2fhir/utils/resource_handler.py
import base64
import datetime
import logging
import os
import time
from typing import List, Tuple
import structlog
import tenacity
from averbis import Pipeline
from fhir.resources.bundle import Bundle
from fhir.resources.codeableconcept import Code... | import base64
import datetime
import logging
import os
import time
from typing import List, Tuple
import structlog
import tenacity
from averbis import Pipeline
from fhir.resources.bundle import Bundle
from fhir.resources.codeableconcept import CodeableConcept
from fhir.resources.composition import Composition, Composi... | en | 0.742758 | Process a list of DocumentReferences Process all FHIR DocumentReference resources from a given bundle # Check if no resource specific section exists ands adds it, # otherwise select the correct section # Text extraction and text analysis # Building FHIR resources as results # if custom_mappers_enabled # de-duplicate an... | 1.949848 | 2 |
maestros/lookups.py | Infinityloopsistemas/SIVA | 0 | 6563 | # -*- coding: utf-8 -*-
from selectable.decorators import login_required
from maestros.models import TiposMedidasActuacion, TiposLimitesCriticos, TiposMedidasVigilancia, TiposTemperaturas, TiposFrecuencias, Zonas, Terceros, CatalogoEquipos, Personal, Consumibles, ParametrosAnalisis, Actividades, Etapas, Peligros, Tipos... | # -*- coding: utf-8 -*-
from selectable.decorators import login_required
from maestros.models import TiposMedidasActuacion, TiposLimitesCriticos, TiposMedidasVigilancia, TiposTemperaturas, TiposFrecuencias, Zonas, Terceros, CatalogoEquipos, Personal, Consumibles, ParametrosAnalisis, Actividades, Etapas, Peligros, Tipos... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.931256 | 2 |
julynter/oldcmd.py | dew-uff/julynter | 9 | 6564 | """Define commands for Python 2.7"""
import argparse
import traceback
from . import util
from .cmd import run
from .cmd import extractpipenv
def main():
"""Main function"""
print("This version is not supported! It has limitted analysis features")
parser = argparse.ArgumentParser(description='Analyze Jupyt... | """Define commands for Python 2.7"""
import argparse
import traceback
from . import util
from .cmd import run
from .cmd import extractpipenv
def main():
"""Main function"""
print("This version is not supported! It has limitted analysis features")
parser = argparse.ArgumentParser(description='Analyze Jupyt... | en | 0.626374 | Define commands for Python 2.7 Main function # pylint: disable=bare-except | 2.501874 | 3 |
gpMgmt/bin/gppylib/test/unit/test_unit_gpcrondump.py | nurikk/gpdb | 0 | 6565 | <filename>gpMgmt/bin/gppylib/test/unit/test_unit_gpcrondump.py
#!/usr/bin/env python
import os
import imp
gpcrondump_path = os.path.abspath('gpcrondump')
gpcrondump = imp.load_source('gpcrondump', gpcrondump_path)
import unittest2 as unittest
from datetime import datetime
from gppylib import gplog
from gpcrondump impo... | <filename>gpMgmt/bin/gppylib/test/unit/test_unit_gpcrondump.py
#!/usr/bin/env python
import os
import imp
gpcrondump_path = os.path.abspath('gpcrondump')
gpcrondump = imp.load_source('gpcrondump', gpcrondump_path)
import unittest2 as unittest
from datetime import datetime
from gppylib import gplog
from gpcrondump impo... | en | 0.637109 | #!/usr/bin/env python ## Enterprise init #If this is successful then it should not raise an exception #If this is successful then it should not raise an exception #If this is successful then it should not raise an exception #Should not raise an exception #------------------------------- Mainline -----------------------... | 2.130372 | 2 |
ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py | vsosrc/ambari | 0 | 6566 | #!/usr/bin/env python
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License")... | #!/usr/bin/env python
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License")... | en | 0.857483 | #!/usr/bin/env python Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you... | 1.617946 | 2 |
test/linux/gyptest-ldflags-from-environment.py | chlorm-forks/gyp | 77 | 6567 | <reponame>chlorm-forks/gyp
#!/usr/bin/env python
# Copyright (c) 2017 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies the use of linker flags in environment variables.
In this test, gyp and build both run in same loca... | #!/usr/bin/env python
# Copyright (c) 2017 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies the use of linker flags in environment variables.
In this test, gyp and build both run in same local environment.
"""
import ... | en | 0.86128 | #!/usr/bin/env python # Copyright (c) 2017 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. Verifies the use of linker flags in environment variables. In this test, gyp and build both run in same local environment. | 2.146862 | 2 |
tests/test_advanced.py | dhaitz/python-package-template | 0 | 6568 | <gh_stars>0
# -*- coding: utf-8 -*-
from .context import sample
def test_thoughts():
assert(sample.hmm() is None)
| # -*- coding: utf-8 -*-
from .context import sample
def test_thoughts():
assert(sample.hmm() is None) | en | 0.769321 | # -*- coding: utf-8 -*- | 1.570708 | 2 |
binary_tree/m_post_order_traversal.py | dhrubach/python-code-recipes | 0 | 6569 | ######################################################################
# LeetCode Problem Number : 145
# Difficulty Level : Medium
# URL : https://leetcode.com/problems/binary-tree-postorder-traversal/
######################################################################
from binary_search_tree.tree_node import TreeNo... | ######################################################################
# LeetCode Problem Number : 145
# Difficulty Level : Medium
# URL : https://leetcode.com/problems/binary-tree-postorder-traversal/
######################################################################
from binary_search_tree.tree_node import TreeNo... | en | 0.64763 | ###################################################################### # LeetCode Problem Number : 145 # Difficulty Level : Medium # URL : https://leetcode.com/problems/binary-tree-postorder-traversal/ ###################################################################### # runtime --> 77.59%, memory --> 50.59% post - ... | 3.883137 | 4 |
dokuwiki.py | luminisward/python-dokuwiki | 0 | 6570 | # -*- coding: utf-8 -*-
"""This python module aims to manage
`DokuWiki <https://www.dokuwiki.org/dokuwiki>`_ wikis by using the
provided `XML-RPC API <https://www.dokuwiki.org/devel:xmlrpc>`_. It is
compatible with python2.7 and python3+.
Installation
------------
It is on `PyPi <https://pypi.python.org/pypi/dokuwik... | # -*- coding: utf-8 -*-
"""This python module aims to manage
`DokuWiki <https://www.dokuwiki.org/dokuwiki>`_ wikis by using the
provided `XML-RPC API <https://www.dokuwiki.org/devel:xmlrpc>`_. It is
compatible with python2.7 and python3+.
Installation
------------
It is on `PyPi <https://pypi.python.org/pypi/dokuwik... | en | 0.630362 | # -*- coding: utf-8 -*- This python module aims to manage `DokuWiki <https://www.dokuwiki.org/dokuwiki>`_ wikis by using the provided `XML-RPC API <https://www.dokuwiki.org/devel:xmlrpc>`_. It is compatible with python2.7 and python3+. Installation ------------ It is on `PyPi <https://pypi.python.org/pypi/dokuwiki>`_... | 2.535363 | 3 |
setup.py | lvgig/test-aide | 2 | 6571 | import setuptools
import re
with open("README.md", "r") as fh:
long_description = fh.read()
# get version from _version.py file, from below
# https://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package
VERSION_FILE = "test_aide/_version.py"
version_file_str = open(VERSION_FILE, "r... | import setuptools
import re
with open("README.md", "r") as fh:
long_description = fh.read()
# get version from _version.py file, from below
# https://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package
VERSION_FILE = "test_aide/_version.py"
version_file_str = open(VERSION_FILE, "r... | en | 0.691533 | # get version from _version.py file, from below # https://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package | 2.009268 | 2 |
examples/pylab_examples/matshow.py | jbbrokaw/matplotlib | 16 | 6572 | """Simple matshow() example."""
from matplotlib.pylab import *
def samplemat(dims):
"""Make a matrix with all zeros and increasing elements on the diagonal"""
aa = zeros(dims)
for i in range(min(dims)):
aa[i, i] = i
return aa
# Display 2 matrices of different sizes
dimlist = [(12, 12), (15, ... | """Simple matshow() example."""
from matplotlib.pylab import *
def samplemat(dims):
"""Make a matrix with all zeros and increasing elements on the diagonal"""
aa = zeros(dims)
for i in range(min(dims)):
aa[i, i] = i
return aa
# Display 2 matrices of different sizes
dimlist = [(12, 12), (15, ... | en | 0.728663 | Simple matshow() example. Make a matrix with all zeros and increasing elements on the diagonal # Display 2 matrices of different sizes # Display a random matrix with a specified figure number and a grayscale # colormap | 3.763572 | 4 |
setup.py | HeyLifeHD/rp-bp | 6 | 6573 | #! /usr/bin/env python3
import importlib
import logging
import os
import subprocess
from setuptools import setup
from setuptools.command.install import install as install
from setuptools.command.develop import develop as develop
logger = logging.getLogger(__name__)
stan_model_files = [
os.path.join("nonperiod... | #! /usr/bin/env python3
import importlib
import logging
import os
import subprocess
from setuptools import setup
from setuptools.command.install import install as install
from setuptools.command.develop import develop as develop
logger = logging.getLogger(__name__)
stan_model_files = [
os.path.join("nonperiod... | en | 0.440274 | #! /usr/bin/env python3 # Compile and pickle the Stan models # default # Check for the prerequisite programs # 0 or 1 # skip if RTD # 0 or 1 # skip if RTD | 1.901729 | 2 |
utils/data_utils.py | BorisMansencal/quickNAT_pytorch | 0 | 6574 | import os
import h5py
import nibabel as nb
import numpy as np
import torch
import torch.utils.data as data
from torchvision import transforms
import utils.preprocessor as preprocessor
# transform_train = transforms.Compose([
# transforms.RandomCrop(200, padding=56),
# transforms.ToTensor(),
# ])
class Imdb... | import os
import h5py
import nibabel as nb
import numpy as np
import torch
import torch.utils.data as data
from torchvision import transforms
import utils.preprocessor as preprocessor
# transform_train = transforms.Compose([
# transforms.RandomCrop(200, padding=56),
# transforms.ToTensor(),
# ])
class Imdb... | en | 0.755424 | # transform_train = transforms.Compose([ # transforms.RandomCrop(200, padding=56), # transforms.ToTensor(), # ]) # def load_file_paths(data_dir, label_dir, volumes_txt_file=None): # """ # This function returns the file paths combined as a list where each element is a 2 element tuple, 0th being data and ... | 2.381241 | 2 |
lib/common/app.py | auho/python-ETL | 0 | 6575 | <filename>lib/common/app.py
import argparse
import yaml
import sys
from .conf import MysqlConf
from lib.db import mysql
parser = argparse.ArgumentParser()
parser.add_argument("--config", help="config file name", type=str, required=False, default='office')
input_args = parser.parse_args()
class PartConfig:
def __... | <filename>lib/common/app.py
import argparse
import yaml
import sys
from .conf import MysqlConf
from lib.db import mysql
parser = argparse.ArgumentParser()
parser.add_argument("--config", help="config file name", type=str, required=False, default='office')
input_args = parser.parse_args()
class PartConfig:
def __... | en | 0.14362 | # type:PartConfig # type:MysqlConf # type: mysql.Mysql | 2.497007 | 2 |
design.py | StrangeArcturus/QtAndRequestParser-Project | 0 | 6576 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'design.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtC... | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'design.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtC... | en | 0.896926 | # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'design.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. | 1.982592 | 2 |
EP_2019/py_impl/main.py | Alisa-lisa/conferences | 5 | 6577 | from simulation.car import spawn_drivers
from simulation.passenger import spawn_passengers
from simulation.core import World, Clock
conf = {
"x": 100,
"y": 100,
"drivers": 200,
"users": 1000,
"start": "2019-07-08T00:00:00",
"end": "2019-07-08T00:01:00"
}
clock = Clock(conf["start"], conf["end"... | from simulation.car import spawn_drivers
from simulation.passenger import spawn_passengers
from simulation.core import World, Clock
conf = {
"x": 100,
"y": 100,
"drivers": 200,
"users": 1000,
"start": "2019-07-08T00:00:00",
"end": "2019-07-08T00:01:00"
}
clock = Clock(conf["start"], conf["end"... | none | 1 | 2.477288 | 2 | |
Python/reverse_with_swap.py | avulaankith/Python | 0 | 6578 | <gh_stars>0
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'reverse_words_order_and_swap_cases' function below.
#
# The function is expected to return a STRING.
# The function accepts STRING sentence as parameter.
#
def reverse_words_order_and_swap_cases(sentence):
# Wr... | #!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'reverse_words_order_and_swap_cases' function below.
#
# The function is expected to return a STRING.
# The function accepts STRING sentence as parameter.
#
def reverse_words_order_and_swap_cases(sentence):
# Write your cod... | en | 0.70215 | #!/bin/python3 # # Complete the 'reverse_words_order_and_swap_cases' function below. # # The function is expected to return a STRING. # The function accepts STRING sentence as parameter. # # Write your code here # continue | 4.159353 | 4 |
playground/check_equal.py | INK-USC/hypter | 11 | 6579 | import json
d1 = {}
with open("/home/qinyuan/zs/out/bart-large-with-description-grouped-1e-5-outerbsz4-innerbsz32-adapterdim4-unfreeze-dec29/test_predictions.jsonl") as fin:
for line in fin:
d = json.loads(line)
d1[d["id"]] = d["output"][0]["answer"]
d2 = {}
dq = {}
with open("/home/qinyuan/zs/out... | import json
d1 = {}
with open("/home/qinyuan/zs/out/bart-large-with-description-grouped-1e-5-outerbsz4-innerbsz32-adapterdim4-unfreeze-dec29/test_predictions.jsonl") as fin:
for line in fin:
d = json.loads(line)
d1[d["id"]] = d["output"][0]["answer"]
d2 = {}
dq = {}
with open("/home/qinyuan/zs/out... | none | 1 | 2.585308 | 3 | |
creeds/static/api1.py | MaayanLab/creeds | 2 | 6580 | <gh_stars>1-10
import json, requests
from pprint import pprint
CREEDS_URL = 'http://amp.pharm.mssm.edu/CREEDS/'
response = requests.get(CREEDS_URL + 'search', params={'q':'STAT3'})
if response.status_code == 200:
pprint(response.json())
json.dump(response.json(), open('api1_result.json', 'wb'), indent=4)
| import json, requests
from pprint import pprint
CREEDS_URL = 'http://amp.pharm.mssm.edu/CREEDS/'
response = requests.get(CREEDS_URL + 'search', params={'q':'STAT3'})
if response.status_code == 200:
pprint(response.json())
json.dump(response.json(), open('api1_result.json', 'wb'), indent=4) | none | 1 | 2.923236 | 3 | |
admin/migrations/0041_course_color.py | rodlukas/UP-admin | 4 | 6581 | <reponame>rodlukas/UP-admin<filename>admin/migrations/0041_course_color.py
# Generated by Django 2.2.3 on 2019-07-31 13:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("admin", "0040_auto_20190718_0938")]
operations = [
migrations.AddField(
... | # Generated by Django 2.2.3 on 2019-07-31 13:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("admin", "0040_auto_20190718_0938")]
operations = [
migrations.AddField(
model_name="course", name="color", field=models.CharField(default="#0... | en | 0.762675 | # Generated by Django 2.2.3 on 2019-07-31 13:54 | 1.66565 | 2 |
exercicios-Python/ex083.py | pedrosimoes-programmer/exercicios-python | 0 | 6582 | # Forma sem bugs
expressao = (str(input('Digite a expressão: ')))
pilhaParenteses = []
for v in expressao:
if v == '(':
pilhaParenteses.append('(')
elif v == ')':
if len(pilhaParenteses) > 0:
pilhaParenteses.pop()
else:
pilhaParenteses.append(')')
bre... | # Forma sem bugs
expressao = (str(input('Digite a expressão: ')))
pilhaParenteses = []
for v in expressao:
if v == '(':
pilhaParenteses.append('(')
elif v == ')':
if len(pilhaParenteses) > 0:
pilhaParenteses.pop()
else:
pilhaParenteses.append(')')
bre... | pt | 0.912846 | # Forma sem bugs # Forma com bugs #expressao = (str(input('Digite a expressão: '))) #if expressao.count('(') == expressao.count(')'): # print('Sua expressão está válida.') #else: # print('Sua expressão está inválida!') | 3.886422 | 4 |
src/inspectortodo/todo.py | code-acrobat/InspectorTodo | 8 | 6583 | # Copyright 2018 TNG Technology Consulting GmbH, Unterföhring, Germany
# Licensed under the Apache License, Version 2.0 - see LICENSE.md in project root directory
import logging
from xml.sax.saxutils import escape
log = logging.getLogger()
class Todo:
def __init__(self, file_path, line_number, content):
... | # Copyright 2018 TNG Technology Consulting GmbH, Unterföhring, Germany
# Licensed under the Apache License, Version 2.0 - see LICENSE.md in project root directory
import logging
from xml.sax.saxutils import escape
log = logging.getLogger()
class Todo:
def __init__(self, file_path, line_number, content):
... | en | 0.643204 | # Copyright 2018 TNG Technology Consulting GmbH, Unterföhring, Germany # Licensed under the Apache License, Version 2.0 - see LICENSE.md in project root directory | 2.528392 | 3 |
generators.py | FabLabUTFSM/fusm_usage_report | 0 | 6584 | import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import plotly.express as px
from plotly.subplots import make_subplots
import pandas as pd
import math
from datetime import datetime, time
from utils import MONTH_NAMES, month_range
def section(title, content, gray=Fa... | import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import plotly.express as px
from plotly.subplots import make_subplots
import pandas as pd
import math
from datetime import datetime, time
from utils import MONTH_NAMES, month_range
def section(title, content, gray=Fa... | en | 0.216435 | TODO: Terminar el heatmap de alguna manera... def fig_uses(df, months): dias = ['Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes'] days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'] data = df[df.index.month.isin(month_range(months))] figure = go.Figure() times = data.groupby([data.ind... | 2.672152 | 3 |
gengine/app/tests_old/test_groups.py | greck2908/gamification-engine | 347 | 6585 | # -*- coding: utf-8 -*-
from gengine.app.tests.base import BaseDBTest
from gengine.app.tests.helpers import create_user, update_user, delete_user, get_or_create_language
from gengine.metadata import DBSession
from gengine.app.model import AuthUser
class TestUserCreation(BaseDBTest):
def test_user_creation(self):... | # -*- coding: utf-8 -*-
from gengine.app.tests.base import BaseDBTest
from gengine.app.tests.helpers import create_user, update_user, delete_user, get_or_create_language
from gengine.metadata import DBSession
from gengine.app.model import AuthUser
class TestUserCreation(BaseDBTest):
def test_user_creation(self):... | en | 0.262066 | # -*- coding: utf-8 -*- #country = "RO", #region = "Transylvania", #city = "Cluj-Napoca", #self.assertTrue(user.country == "RO") #self.assertTrue(user.region == "Transylvania") #self.assertTrue(user.city == "Cluj-Napoca") #country = "EN", #region = "Transylvania", #city = "Cluj-Napoca", # Correct cases #self.assertTrue... | 2.317055 | 2 |
Lib/fontTools/designspaceLib/__init__.py | guorenxi/fonttools | 0 | 6586 | from __future__ import annotations
import collections
import copy
import itertools
import math
import os
import posixpath
from io import BytesIO, StringIO
from textwrap import indent
from typing import Any, Dict, List, MutableMapping, Optional, Tuple, Union
from fontTools.misc import etree as ET
from fontTools.misc i... | from __future__ import annotations
import collections
import copy
import itertools
import math
import os
import posixpath
from io import BytesIO, StringIO
from textwrap import indent
from typing import Any, Dict, List, MutableMapping, Optional, Tuple, Union
from fontTools.misc import etree as ET
from fontTools.misc i... | en | 0.730484 | designSpaceDocument - read and write designspace files # ElementTree allows to find namespace-prefixed elements, but not attributes # so we have to do it ourselves for 'xml:lang' Normalize paths using forward slash to work also on Windows. # The above transformation loses absolute paths # The above transformation ... | 2.238976 | 2 |
ax/models/torch/posterior_mean.py | dme65/Ax | 1 | 6587 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Any, Optional, Tuple
import torch
from botorch.acquisition.acquisition import AcquisitionFunction
... | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Any, Optional, Tuple
import torch
from botorch.acquisition.acquisition import AcquisitionFunction
... | en | 0.876263 | #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. Instantiates a PosteriorMean acquisition function. Note: If no OutcomeConstraints given, return an analytic acquisi... | 1.841279 | 2 |
src/drivers/velodyne_nodes/test/velodyne_node.test.py | fanyu2021/fyAutowareAuto | 0 | 6588 | # Copyright 2018 the Autoware Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | # Copyright 2018 the Autoware Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | en | 0.871474 | # Copyright 2018 the Autoware Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ... | 1.915623 | 2 |
example.py | manhcuogntin4/Color-transfer | 0 | 6589 | # USAGE
# python example.py --source images/ocean_sunset.jpg --target images/ocean_day.jpg
# import the necessary packages
from color_transfer import color_transfer
import numpy as np
import argparse
import cv2
def show_image(title, image, width = 300):
# resize the image to have a constant width, just to
# make di... | # USAGE
# python example.py --source images/ocean_sunset.jpg --target images/ocean_day.jpg
# import the necessary packages
from color_transfer import color_transfer
import numpy as np
import argparse
import cv2
def show_image(title, image, width = 300):
# resize the image to have a constant width, just to
# make di... | en | 0.628224 | # USAGE # python example.py --source images/ocean_sunset.jpg --target images/ocean_day.jpg # import the necessary packages # resize the image to have a constant width, just to # make displaying the images take up less screen real # estate # show the resized image # construct the argument parser and parse the arguments ... | 3.405366 | 3 |
scripts/registration_pipeline.py | heethesh/Argoverse-HDMap-Update | 0 | 6590 | import copy
import numpy as np
import open3d as o3d
from tqdm import tqdm
from scipy import stats
import utils_o3d as utils
def remove_ground_plane(pcd, z_thresh=-2.7):
cropped = copy.deepcopy(pcd)
cropped_points = np.array(cropped.points)
cropped_points = cropped_points[cropped_points[:, -1] > z_thresh... | import copy
import numpy as np
import open3d as o3d
from tqdm import tqdm
from scipy import stats
import utils_o3d as utils
def remove_ground_plane(pcd, z_thresh=-2.7):
cropped = copy.deepcopy(pcd)
cropped_points = np.array(cropped.points)
cropped_points = cropped_points[cropped_points[:, -1] > z_thresh... | en | 0.350311 | # Downsample the point cloud using Voxel grids # Estimate normals # Compute FPFH features # pcd_dso = utils.scale_point_cloud(pcd_dso, dso_scale).rotate([0.5, 0.5, 0.5]).translate([10, 20, 30]) # Ground plane removal results # utils.display(pcds=[pcd_lidar, pcd_dso], colors=[[1, 0.706, 0], [0, 0.651, 0.929]]) # utils.d... | 2.343046 | 2 |
neo4j/aio/__init__.py | michaelcraige/neo4j-python-driver | 1 | 6591 | <filename>neo4j/aio/__init__.py
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) 2002-2019 "Neo4j,"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
... | <filename>neo4j/aio/__init__.py
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) 2002-2019 "Neo4j,"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
... | en | 0.842519 | #!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright (c) 2002-2019 "Neo4j," # Neo4j Sweden AB [http://neo4j.com] # # This file is part of Neo4j. # # 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 Li... | 1.837268 | 2 |
python/setup.py | bubriks/feature-store-api | 49 | 6592 | import os
import imp
from setuptools import setup, find_packages
__version__ = imp.load_source(
"hsfs.version", os.path.join("hsfs", "version.py")
).__version__
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="hsfs",
version=__version__,
install_... | import os
import imp
from setuptools import setup, find_packages
__version__ = imp.load_source(
"hsfs.version", os.path.join("hsfs", "version.py")
).__version__
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="hsfs",
version=__version__,
install_... | none | 1 | 1.547122 | 2 | |
src/server_py3/aps/src/wes/api/v1/users/__init__.py | kfrime/yonder | 0 | 6593 | #!/usr/bin/env python3
from . import signup, signin, signout, update, info, detail
| #!/usr/bin/env python3
from . import signup, signin, signout, update, info, detail
| fr | 0.221828 | #!/usr/bin/env python3 | 1.057909 | 1 |
hubconf.py | jamesmcclain/pytorch-multi-class-focal-loss | 81 | 6594 | <reponame>jamesmcclain/pytorch-multi-class-focal-loss
# Optional list of dependencies required by the package
dependencies = ['torch']
from focal_loss import FocalLoss, focal_loss
| # Optional list of dependencies required by the package
dependencies = ['torch']
from focal_loss import FocalLoss, focal_loss | en | 0.827192 | # Optional list of dependencies required by the package | 1.235919 | 1 |
autotest/ogr/ogr_gpx.py | HongqiangWei/gdal | 3 | 6595 | <reponame>HongqiangWei/gdal
#!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test GPX driver functionality.
# Author: <NAME> <even dot rouault at mines dash paris dot org>
#
#####################################... | #!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test GPX driver functionality.
# Author: <NAME> <even dot rouault at mines dash paris dot org>
#
#################################################################... | de | 0.319261 | #!/usr/bin/env python ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GPX driver functionality. # Author: <NAME> <even dot rouault at mines dash paris dot org> # ##################################################################... | 1.706356 | 2 |
mwp_solver/models/sausolver.py | max-stack/MWP-SS-Metrics | 0 | 6596 | # Code Taken from https://github.com/LYH-YF/MWPToolkit
# -*- encoding: utf-8 -*-
# @Author: <NAME>
# @Time: 2021/08/21 04:59:55
# @File: sausolver.py
import random
import torch
from torch import nn
import copy
from module.Encoder.rnn_encoder import BasicRNNEncoder
from module.Embedder.basic_embedder import BasicEmbed... | # Code Taken from https://github.com/LYH-YF/MWPToolkit
# -*- encoding: utf-8 -*-
# @Author: <NAME>
# @Time: 2021/08/21 04:59:55
# @File: sausolver.py
import random
import torch
from torch import nn
import copy
from module.Encoder.rnn_encoder import BasicRNNEncoder
from module.Embedder.basic_embedder import BasicEmbed... | en | 0.428956 | # Code Taken from https://github.com/LYH-YF/MWPToolkit # -*- encoding: utf-8 -*- # @Author: <NAME> # @Time: 2021/08/21 04:59:55 # @File: sausolver.py Reference: Qin et al. "Semantically-Aligned Universal Tree-Structured Solver for Math Word Problems" in EMNLP 2020. # parameter # module # self.t_encoder = BasicR... | 2.190217 | 2 |
rosetta/tests/test_parallel.py | rafacarrascosa/rosetta | 1 | 6597 | <filename>rosetta/tests/test_parallel.py
import unittest
from functools import partial
import pandas as pd
from pandas.util.testing import assert_frame_equal, assert_series_equal
import numpy as np
import threading
from StringIO import StringIO
from rosetta.parallel import parallel_easy, pandas_easy
from rosetta.para... | <filename>rosetta/tests/test_parallel.py
import unittest
from functools import partial
import pandas as pd
from pandas.util.testing import assert_frame_equal, assert_series_equal
import numpy as np
import threading
from StringIO import StringIO
from rosetta.parallel import parallel_easy, pandas_easy
from rosetta.para... | en | 0.66565 | # A couple functions for testing parallel easy # Must be defined outside of the test class for some reason. Tests the parallel_easy module. For n_jobs positive, the wrap should return n_jobs. For n_jobs zero, the wrap should raise a ValueError Tests the parallel_easy.map_easy_padded_blocks function. #self.numbers_1 = [... | 2.76232 | 3 |
modules/helper/subtitles/subtitles.py | sdelcore/video-event-notifier-old | 0 | 6598 | import time
import srt
import re
import datetime
from mqtthandler import MQTTHandler
INIT_STATUS={
"video": {
"title": None,
"series_title": None,
"season": None,
"episode": None
},
"time": None,
"events": None
}
class SubtitleHandler:
subtitles = []
phrases = ... | import time
import srt
import re
import datetime
from mqtthandler import MQTTHandler
INIT_STATUS={
"video": {
"title": None,
"series_title": None,
"season": None,
"episode": None
},
"time": None,
"events": None
}
class SubtitleHandler:
subtitles = []
phrases = ... | en | 0.856435 | #TODO determine how to set up phrase data #f = self.isPhraseInLine(line,sub, firstpart) #s = self.isPhraseInLine(line,sub, secondpart) #if f + s == 0: # mult += self.isPhraseInLine(line,sub,sub.content ) #else: # mult += f+s ## DEAR LESS DRUNK SELF # this currently adds the number of events over the entire subti... | 2.889181 | 3 |
thecsvparser.py | rbago/CEBD1160_Class4_hwk | 0 | 6599 | #!/usr/bin/env python
import os
import numpy as np
import pandas as pd
os.getcwd()
# Request for the filename
# Current version of this script works only with TSV type files
mainFilename = input('Input your file name (diabetes.tab.txt or housing.data.txt): ')
print()
# To create proper dataframe, transforming it wi... | #!/usr/bin/env python
import os
import numpy as np
import pandas as pd
os.getcwd()
# Request for the filename
# Current version of this script works only with TSV type files
mainFilename = input('Input your file name (diabetes.tab.txt or housing.data.txt): ')
print()
# To create proper dataframe, transforming it wi... | en | 0.685127 | #!/usr/bin/env python # Request for the filename # Current version of this script works only with TSV type files # To create proper dataframe, transforming it with numpy # Then changing it with pandas # Obtains first row to identify header is string or numeric # Changes strings to numbers (self identifies for float or ... | 3.627276 | 4 |