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 |
|---|---|---|---|---|---|---|---|---|---|---|
onelearn/utils.py | onelearn/onelearn | 16 | 6621051 | <gh_stars>10-100
# Authors: <NAME> <<EMAIL>>
# License: BSD 3 clause
import os
from math import log, exp
import numpy as np
from numpy.random import uniform
from numba import njit
from numba.types import float32, uint32
def get_type(class_):
"""Gives the numba type of an object is numba.jit decorators are enabled... | # Authors: <NAME> <<EMAIL>>
# License: BSD 3 clause
import os
from math import log, exp
import numpy as np
from numpy.random import uniform
from numba import njit
from numba.types import float32, uint32
def get_type(class_):
"""Gives the numba type of an object is numba.jit decorators are enabled and None
oth... | en | 0.740215 | # Authors: <NAME> <<EMAIL>> # License: BSD 3 clause Gives the numba type of an object is numba.jit decorators are enabled and None otherwise. This helps to get correct coverage of the code Parameters ---------- class_ : `object` A class Returns ------- output : `object` A n... | 3.085034 | 3 |
pyfos/pyfos_util.py | ValeJM/PyFos | 0 | 6621052 | # Copyright 2017 Brocade Communications Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may also obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | # Copyright 2017 Brocade Communications Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may also obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | en | 0.769175 | # Copyright 2017 Brocade Communications Systems, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may also obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir... | 2.034297 | 2 |
utility/test_gen_resource_tests.py | Ed-Fi-Exchange-OSS/Suite-3-Performance-Testing | 0 | 6621053 | <reponame>Ed-Fi-Exchange-OSS/Suite-3-Performance-Testing<filename>utility/test_gen_resource_tests.py
# SPDX-License-Identifier: Apache-2.0
# Licensed to the Ed-Fi Alliance under one or more agreements.
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES fi... | # SPDX-License-Identifier: Apache-2.0
# Licensed to the Ed-Fi Alliance under one or more agreements.
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES files in the project root for more information.
from pytest import mark, fixture
import json
import g... | en | 0.600877 | # SPDX-License-Identifier: Apache-2.0 # Licensed to the Ed-Fi Alliance under one or more agreements. # The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. # See the LICENSE and NOTICES files in the project root for more information. # A simple scenario # More complex - has a reference # ... | 2.244612 | 2 |
catd/__init__.py | dqwert/catd | 0 | 6621054 | from catd import util
from .WordNet import WordNet
from .Doc import Doc
from .WordNode import WordNode
import logging
__version__ = '0.5.0'
| from catd import util
from .WordNet import WordNet
from .Doc import Doc
from .WordNode import WordNode
import logging
__version__ = '0.5.0'
| none | 1 | 1.17816 | 1 | |
pox/openflow/discovery.py | korrigans84/pox_network | 416 | 6621055 | # Copyright 2011-2013 <NAME>
#
# 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 2011-2013 <NAME>
#
# 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.878922 | # Copyright 2011-2013 <NAME> # # 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.883736 | 2 |
full_scrapper.py | CarloGauss33/scrap-diputados | 2 | 6621056 | <filename>full_scrapper.py
import sys
import simple_scrap
from urllib.request import urlopen
import urllib
from bs4 import BeautifulSoup
import json
import os
def get_last_id():
pure_html = urlopen("https://www.camara.cl/legislacion/sala_sesiones/votaciones.aspx")
soup_html = BeautifulSoup(pure_html, 'html.pa... | <filename>full_scrapper.py
import sys
import simple_scrap
from urllib.request import urlopen
import urllib
from bs4 import BeautifulSoup
import json
import os
def get_last_id():
pure_html = urlopen("https://www.camara.cl/legislacion/sala_sesiones/votaciones.aspx")
soup_html = BeautifulSoup(pure_html, 'html.pa... | en | 0.436505 | #opening the results table #getting the last votation | 2.847281 | 3 |
DeblurGAN-tf/00-access/data.py | NALLEIN/Ascend | 0 | 6621057 | <reponame>NALLEIN/Ascend
import random
import pathlib
import tensorflow as tf
def preprocess_image(image, ext):
"""
Normalize image to [-1, 1]
"""
assert ext in ['.png', '.jpg', '.jpeg', '.JPEG']
if ext == '.png':
image = tf.image.decode_png(image, channels=3)
else:
image = tf.... | import random
import pathlib
import tensorflow as tf
def preprocess_image(image, ext):
"""
Normalize image to [-1, 1]
"""
assert ext in ['.png', '.jpg', '.jpeg', '.JPEG']
if ext == '.png':
image = tf.image.decode_png(image, channels=3)
else:
image = tf.image.decode_jpeg(image, ... | en | 0.866019 | Normalize image to [-1, 1] | 2.439815 | 2 |
troposphere_mate/applicationinsights.py | tsuttsu305/troposphere_mate-project | 0 | 6621058 | <filename>troposphere_mate/applicationinsights.py
# -*- coding: utf-8 -*-
"""
This code is auto generated from troposphere_mate.code_generator.__init__.py scripts.
"""
import sys
if sys.version_info.major >= 3 and sys.version_info.minor >= 5: # pragma: no cover
from typing import Union, List, Any
import troposp... | <filename>troposphere_mate/applicationinsights.py
# -*- coding: utf-8 -*-
"""
This code is auto generated from troposphere_mate.code_generator.__init__.py scripts.
"""
import sys
if sys.version_info.major >= 3 and sys.version_info.minor >= 5: # pragma: no cover
from typing import Union, List, Any
import troposp... | en | 0.327073 | # -*- coding: utf-8 -*- This code is auto generated from troposphere_mate.code_generator.__init__.py scripts. # pragma: no cover # type: Union[str, AWSHelperFn] # type: Union[str, AWSHelperFn] # type: Union[str, AWSHelperFn] # type: Union[str, AWSHelperFn] # type: Union[str, AWSHelperFn] # type: Union[str, AWSHelperFn]... | 1.776218 | 2 |
utility/bf2mugi.py | hvze/Mugi | 1 | 6621059 | <reponame>hvze/Mugi<filename>utility/bf2mugi.py
import sys
res = ''
for (i, c) in enumerate(" ".join(sys.argv[1:])):
for (x, y) in [('>', 'r'), ('<', 'l'), ('+', 'p'), ('-', 'm'), ('.', 'o')]:
if x == c:
res += y
print(res) | import sys
res = ''
for (i, c) in enumerate(" ".join(sys.argv[1:])):
for (x, y) in [('>', 'r'), ('<', 'l'), ('+', 'p'), ('-', 'm'), ('.', 'o')]:
if x == c:
res += y
print(res) | none | 1 | 3.452928 | 3 | |
webapp/app.py | rohitnayak/movie-review-sentiment-analysis | 0 | 6621060 | from flask import Flask, render_template, request, send_file
from wtforms import Form, TextAreaField, validators
import pickle, sqlite3, os, numpy as np
from vectorizer import vect
import uuid, json
import facerecognition.recognize as REC
import base64
import io
import logging, logging.config
import sys
LOGGING = {
... | from flask import Flask, render_template, request, send_file
from wtforms import Form, TextAreaField, validators
import pickle, sqlite3, os, numpy as np
from vectorizer import vect
import uuid, json
import facerecognition.recognize as REC
import base64
import io
import logging, logging.config
import sys
LOGGING = {
... | none | 1 | 2.369567 | 2 | |
packages/core/minos-microservice-aggregate/minos/aggregate/transactions/repositories/__init__.py | minos-framework/minos-python | 247 | 6621061 | <filename>packages/core/minos-microservice-aggregate/minos/aggregate/transactions/repositories/__init__.py
from .abc import (
TransactionRepository,
)
from .database import (
DatabaseTransactionRepository,
TransactionDatabaseOperationFactory,
)
from .memory import (
InMemoryTransactionRepository,
)
| <filename>packages/core/minos-microservice-aggregate/minos/aggregate/transactions/repositories/__init__.py
from .abc import (
TransactionRepository,
)
from .database import (
DatabaseTransactionRepository,
TransactionDatabaseOperationFactory,
)
from .memory import (
InMemoryTransactionRepository,
)
| none | 1 | 1.454719 | 1 | |
Day 3/part1.py | jonomango/advent-of-code-2021 | 0 | 6621062 | import math
import copy
from functools import reduce
arr = [0 for i in range(12)]
with open("input.txt", "r") as file:
# iterate over every line in a file
for line in file.read().strip().split("\n"):
for i in range(12):
if line[i] == '1':
arr[i] += 1
else:
arr[i] -= 1
g = ""
e = ... | import math
import copy
from functools import reduce
arr = [0 for i in range(12)]
with open("input.txt", "r") as file:
# iterate over every line in a file
for line in file.read().strip().split("\n"):
for i in range(12):
if line[i] == '1':
arr[i] += 1
else:
arr[i] -= 1
g = ""
e = ... | en | 0.934466 | # iterate over every line in a file | 3.181499 | 3 |
paradigmes/live_coding_2019_10_14/fonctionnel02.py | yostane/python-paradigmes-et-structures-de-donnees | 0 | 6621063 | <filename>paradigmes/live_coding_2019_10_14/fonctionnel02.py
l = [1, 2, 3, 4, 5, 6, 7]
def est_pair(x): # retourne true si x est pair
return x % 2 == 0
liste_filtree = filter(est_pair, l)
print(list(liste_filtree)) # je dois repréciser que c une liste
print(list(filter(lambda y: y >= 5, l)))
print(list(map(la... | <filename>paradigmes/live_coding_2019_10_14/fonctionnel02.py
l = [1, 2, 3, 4, 5, 6, 7]
def est_pair(x): # retourne true si x est pair
return x % 2 == 0
liste_filtree = filter(est_pair, l)
print(list(liste_filtree)) # je dois repréciser que c une liste
print(list(filter(lambda y: y >= 5, l)))
print(list(map(la... | fr | 0.979998 | # retourne true si x est pair # je dois repréciser que c une liste # le double de chaque élément # le double des éléments >= 5 # compréhension de liste # on peut trasformer vers un autre type avec map | 3.555641 | 4 |
appengine/networkx/algorithms/tests/test_swap.py | CSE512-15S/a3-haynesb-Pending | 12 | 6621064 | <reponame>CSE512-15S/a3-haynesb-Pending
#!/usr/bin/env python
from nose.tools import *
from networkx import *
def test_double_edge_swap():
graph = barabasi_albert_graph(200,1)
degreeStart = sorted(graph.degree().values())
G = connected_double_edge_swap(graph, 40)
assert_true(is_connected(graph))
de... | #!/usr/bin/env python
from nose.tools import *
from networkx import *
def test_double_edge_swap():
graph = barabasi_albert_graph(200,1)
degreeStart = sorted(graph.degree().values())
G = connected_double_edge_swap(graph, 40)
assert_true(is_connected(graph))
degseq = sorted(graph.degree().values())
... | ru | 0.26433 | #!/usr/bin/env python | 2.639343 | 3 |
newt/magnetometer.py | acrerd/newt | 0 | 6621065 | import requests
import datetime
import pandas
import numpy as np
from instruments import Instrument
from . import config
class Magnetometer(Instrument):
"""
Represent the magnetometer.
"""
root_url = config.get("magnetometer", "url")
def __init__(self):
pass
def _determi... | import requests
import datetime
import pandas
import numpy as np
from instruments import Instrument
from . import config
class Magnetometer(Instrument):
"""
Represent the magnetometer.
"""
root_url = config.get("magnetometer", "url")
def __init__(self):
pass
def _determi... | en | 0.746251 | Represent the magnetometer. # as timedelta #download = self._apply_reductions(download) #data[["x", "y", "z"]] += np.median(data[["x", "y", "z"]], axis=0) #da = (data.index[-1] - data.index[0]).days # 49891 / (ftot) # the field in the current axes (from a median of a lot of data) # the field in the target axes (from th... | 3.039838 | 3 |
fetchers/FetcherController.py | OneStarSolution/prometeo | 0 | 6621066 | <filename>fetchers/FetcherController.py<gh_stars>0
from pymongo import UpdateOne
from db.PrometeoDB import PrometeoDB
class FetcherController:
def save(self, documents):
document_dicts = []
for document in documents:
if not isinstance(document, dict):
document = docume... | <filename>fetchers/FetcherController.py<gh_stars>0
from pymongo import UpdateOne
from db.PrometeoDB import PrometeoDB
class FetcherController:
def save(self, documents):
document_dicts = []
for document in documents:
if not isinstance(document, dict):
document = docume... | none | 1 | 2.67094 | 3 | |
Chapter11/clients/log-fluent.py | nontster/LoggingInActionWithFluentd | 11 | 6621067 | <reponame>nontster/LoggingInActionWithFluentd
#This implementation makes use of the Fluentd implementation directly without the use of
# the Python logging framework
import datetime, time
from fluent import handler, sender
fluentSender = sender.FluentSender('test', host='localhost', port=18090)
# using the Fluentd Han... | #This implementation makes use of the Fluentd implementation directly without the use of
# the Python logging framework
import datetime, time
from fluent import handler, sender
fluentSender = sender.FluentSender('test', host='localhost', port=18090)
# using the Fluentd Handler means that msgpack will be used and there... | en | 0.788355 | #This implementation makes use of the Fluentd implementation directly without the use of # the Python logging framework # using the Fluentd Handler means that msgpack will be used and therefore the source plugin in Fluentd is a forward plugin. | 2.408674 | 2 |
neural_exploration/visualize/views.py | brookefitzgerald/neural_exploration | 0 | 6621068 | <filename>neural_exploration/visualize/views.py
from django.apps import apps
from django.shortcuts import render
from rest_framework import renderers, viewsets, status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from .serializers import DataSerializer, FirstBinSerialize... | <filename>neural_exploration/visualize/views.py
from django.apps import apps
from django.shortcuts import render
from rest_framework import renderers, viewsets, status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from .serializers import DataSerializer, FirstBinSerialize... | en | 0.774586 | get data from specific site Get specific data with specific bin size Get all data with specific bin size | 2.219834 | 2 |
tests/conftest.py | mitrofun/skeletonWSGI | 0 | 6621069 | <gh_stars>0
import os
import sys
import pytest
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, ROOT_DIR)
sys.path.insert(0, os.path.join(ROOT_DIR, 'core'))
@pytest.fixture
def root_path():
return os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), ... | import os
import sys
import pytest
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, ROOT_DIR)
sys.path.insert(0, os.path.join(ROOT_DIR, 'core'))
@pytest.fixture
def root_path():
return os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
@py... | none | 1 | 2.153128 | 2 | |
app/auth/views.py | Jeffiy/zblog | 3 | 6621070 | <reponame>Jeffiy/zblog
#!/usr/bin/env python
# encoding:utf-8
from flask import render_template, redirect, request, url_for, flash
from flask.ext.login import login_user, login_required, logout_user, current_user
from app.auth import auth
from app.models import db, User
from app.auth.forms import LoginForm, ChangePwd... | #!/usr/bin/env python
# encoding:utf-8
from flask import render_template, redirect, request, url_for, flash
from flask.ext.login import login_user, login_required, logout_user, current_user
from app.auth import auth
from app.models import db, User
from app.auth.forms import LoginForm, ChangePwdForm
__author__ = 'zha... | en | 0.333197 | #!/usr/bin/env python # encoding:utf-8 | 2.5352 | 3 |
tests/test_socfaker_file.py | priamai/soc-faker | 122 | 6621071 | <reponame>priamai/soc-faker
def test_socfaker_file_name(socfaker_fixture):
assert socfaker_fixture.file.name
def test_socfaker_file_extension(socfaker_fixture):
assert socfaker_fixture.file.extension
def test_socfaker_file_size(socfaker_fixture):
assert socfaker_fixture.file.size
def test_socfaker_file_t... | def test_socfaker_file_name(socfaker_fixture):
assert socfaker_fixture.file.name
def test_socfaker_file_extension(socfaker_fixture):
assert socfaker_fixture.file.extension
def test_socfaker_file_size(socfaker_fixture):
assert socfaker_fixture.file.size
def test_socfaker_file_timestamp(socfaker_fixture):
... | none | 1 | 1.761338 | 2 | |
hmc/algorithm/io/lib_data_geo_ascii.py | c-hydro/hmc | 0 | 6621072 | <reponame>c-hydro/hmc
"""
Class Features
Name: lib_data_geo_ascii
Author(s): <NAME> (<EMAIL>)
Date: '20200401'
Version: '3.0.0'
"""
#######################################################################################
# Libraries
import logging
import rasterio
import os
import numpy as ... | """
Class Features
Name: lib_data_geo_ascii
Author(s): <NAME> (<EMAIL>)
Date: '20200401'
Version: '3.0.0'
"""
#######################################################################################
# Libraries
import logging
import rasterio
import os
import numpy as np
from rasterio.crs ... | en | 0.257533 | Class Features Name: lib_data_geo_ascii Author(s): <NAME> (<EMAIL>) Date: '20200401' Version: '3.0.0' ####################################################################################### # Libraries # Logging # Debug #######################################################################... | 2.166425 | 2 |
images/forms.py | cebanauskes/ida_images | 0 | 6621073 | import requests
from urllib.request import urlopen
from urllib.error import HTTPError
from django import forms
from django.core.exceptions import ValidationError
from .models import Image
from .utils import valid_url_mimetype
class ImageForm(forms.ModelForm):
"""Форма для добавления иизображения на основе модели... | import requests
from urllib.request import urlopen
from urllib.error import HTTPError
from django import forms
from django.core.exceptions import ValidationError
from .models import Image
from .utils import valid_url_mimetype
class ImageForm(forms.ModelForm):
"""Форма для добавления иизображения на основе модели... | ru | 0.997711 | Форма для добавления иизображения на основе модели Image Проверяет, чтобы только одно поле было заполнено Проверяет, работоспособна ли ссылка и работоспособна ли ссылка Форма для изменения размера изображения Проверяет, чтобы хотя бы одно поле было заполнено | 2.873875 | 3 |
gogorat.py | talesmarra/GoGoRat | 2 | 6621074 | <gh_stars>1-10
#IA created to be integrated as a player in the PyRat Game.
#Winner of the competition between AI's in the first semester of 2019.
#This AI combines a Supervised Approach with a CGT approach in order to obtain maximum performance,
#not only against the greedy algorithm but also against other types of AI.... | #IA created to be integrated as a player in the PyRat Game.
#Winner of the competition between AI's in the first semester of 2019.
#This AI combines a Supervised Approach with a CGT approach in order to obtain maximum performance,
#not only against the greedy algorithm but also against other types of AI.
# The supervis... | en | 0.932487 | #IA created to be integrated as a player in the PyRat Game. #Winner of the competition between AI's in the first semester of 2019. #This AI combines a Supervised Approach with a CGT approach in order to obtain maximum performance, #not only against the greedy algorithm but also against other types of AI. # The supervis... | 3.239888 | 3 |
tests/resources/test_numbers.py | vaibhav-plivo/plivo-python | 42 | 6621075 | # -*- coding: utf-8 -*-
import plivo
from tests.base import PlivoResourceTestCase
from tests.decorators import with_response
number_id = '123'
class NumberTest(PlivoResourceTestCase):
@with_response(200)
def test_list(self):
numbers = self.client.numbers.list(
number_startswith=24,
... | # -*- coding: utf-8 -*-
import plivo
from tests.base import PlivoResourceTestCase
from tests.decorators import with_response
number_id = '123'
class NumberTest(PlivoResourceTestCase):
@with_response(200)
def test_list(self):
numbers = self.client.numbers.list(
number_startswith=24,
... | en | 0.707933 | # -*- coding: utf-8 -*- # Test if ListResponseObject's __iter__ is working correctly # Verifying the endpoint hit # Verifying the method used | 2.627016 | 3 |
_all.py | un-pogaz/MC-Decompil-Generated-data | 0 | 6621076 | <gh_stars>0
import sys
print('--==| Minecraft: Build all Generated data |==--')
print()
print('It can be a lot of files, are you sure to do it?')
if not input()[:1] == 'y': sys.exit()
from builder.generated_data_builder import args, build_generated_data, version_manifest
args.manifest_json = None
args.overwrite = F... | import sys
print('--==| Minecraft: Build all Generated data |==--')
print()
print('It can be a lot of files, are you sure to do it?')
if not input()[:1] == 'y': sys.exit()
from builder.generated_data_builder import args, build_generated_data, version_manifest
args.manifest_json = None
args.overwrite = False
args.ou... | none | 1 | 2.49279 | 2 | |
examples/python/usm_memory_operation.py | vlad-perevezentsev/dpctl | 0 | 6621077 | import dpctl
import dpctl.memory as dpmem
import numpy as np
ms = dpmem.MemoryUSMShared(32)
md = dpmem.MemoryUSMDevice(32)
host_buf = np.random.randint(0, 42, dtype=np.uint8, size=32)
# copy host byte-like object to USM-device buffer
md.copy_from_host(host_buf)
# copy USM-device buffer to USM-shared buffer in paral... | import dpctl
import dpctl.memory as dpmem
import numpy as np
ms = dpmem.MemoryUSMShared(32)
md = dpmem.MemoryUSMDevice(32)
host_buf = np.random.randint(0, 42, dtype=np.uint8, size=32)
# copy host byte-like object to USM-device buffer
md.copy_from_host(host_buf)
# copy USM-device buffer to USM-shared buffer in paral... | en | 0.648832 | # copy host byte-like object to USM-device buffer # copy USM-device buffer to USM-shared buffer in parallel (using sycl::queue::memcpy) # build numpy array reusing host-accessible USM-shared memory # Display Python object NumPy ndarray is viewing into # Print content of the view # Print content of the original host buf... | 2.699753 | 3 |
networks/generator.py | andgitisaac/MNIST_GAN | 0 | 6621078 | <filename>networks/generator.py
import torch
import torch.nn as nn
import torch.nn.functional as F
class Generator(nn.Module):
def __init__(self, GANType, zDim, numClasses=10):
super(Generator, self).__init__()
if GANType in ["CGAN", "ACGAN"]:
zDim += numClasses
self.conv1 = nn.... | <filename>networks/generator.py
import torch
import torch.nn as nn
import torch.nn.functional as F
class Generator(nn.Module):
def __init__(self, GANType, zDim, numClasses=10):
super(Generator, self).__init__()
if GANType in ["CGAN", "ACGAN"]:
zDim += numClasses
self.conv1 = nn.... | none | 1 | 2.725573 | 3 | |
lib/tsdesktop/bottman/views/dockman_test.py | tsadm/desktop | 0 | 6621079 | <filename>lib/tsdesktop/bottman/views/dockman_test.py
from tsdesktop.testing import TSDesktopTest
from .dockman import view
from tsdesktop import dockman
from bottle import HTTPResponse, HTTPError
images = [{}]
containers = [{'Status': None}]
class Views(TSDesktopTest):
cli = None
def setUp(self):
se... | <filename>lib/tsdesktop/bottman/views/dockman_test.py
from tsdesktop.testing import TSDesktopTest
from .dockman import view
from tsdesktop import dockman
from bottle import HTTPResponse, HTTPError
images = [{}]
containers = [{'Status': None}]
class Views(TSDesktopTest):
cli = None
def setUp(self):
se... | none | 1 | 2.464234 | 2 | |
pip_services3_datadog/clients/DataDogMetricsClient.py | pip-services3-python/pip-services3-datadog-python | 0 | 6621080 | # -*- coding: utf-8 -*-
import datetime
from typing import Optional, List
from pip_services3_commons.config import ConfigParams
from pip_services3_commons.convert import StringConverter
from pip_services3_commons.errors import ConfigException
from pip_services3_commons.refer import IReferences
from pip_services3_compo... | # -*- coding: utf-8 -*-
import datetime
from typing import Optional, List
from pip_services3_commons.config import ConfigParams
from pip_services3_commons.convert import StringConverter
from pip_services3_commons.errors import ConfigException
from pip_services3_commons.refer import IReferences
from pip_services3_compo... | en | 0.656638 | # -*- coding: utf-8 -*- # Commented instrumentation because otherwise it will never stop sending logs... # timing = self._instrument(correlation_id, 'datadog.send_metrics') # timing.end_timing() | 1.971296 | 2 |
devincachu/inscricao/tests/test_model_configuracao.py | devincachu/devincachu-2013 | 3 | 6621081 | # -*- coding: utf-8 -*-
# Copyright 2013 <NAME> authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import unittest
from django.db import models as django_models
from .. import models
class ConfiguracaoTestCase(unittest.TestCase):
... | # -*- coding: utf-8 -*-
# Copyright 2013 <NAME> authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import unittest
from django.db import models as django_models
from .. import models
class ConfiguracaoTestCase(unittest.TestCase):
... | en | 0.90995 | # -*- coding: utf-8 -*- # Copyright 2013 <NAME> authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. | 2.431134 | 2 |
test/test_cards.py | volfpeter/markyp-bootstrap4 | 21 | 6621082 | <filename>test/test_cards.py
from markyp_bootstrap4.cards import *
def test_title():
assert title.h1("Text").markup ==\
'<h1 class="card-title">Text</h1>'
assert title.h2("Text").markup ==\
'<h2 class="card-title">Text</h2>'
assert title.h3("Text").markup ==\
'<h3 class="card-title"... | <filename>test/test_cards.py
from markyp_bootstrap4.cards import *
def test_title():
assert title.h1("Text").markup ==\
'<h1 class="card-title">Text</h1>'
assert title.h2("Text").markup ==\
'<h2 class="card-title">Text</h2>'
assert title.h3("Text").markup ==\
'<h3 class="card-title"... | none | 1 | 2.735601 | 3 | |
swizzle.py | anjiro/bearutils | 13 | 6621083 | <reponame>anjiro/bearutils
# coding: utf-8
from objc_util import *
from objc_util import parse_types
import ctypes
import inspect
import sys
def _str_to_bytes(s):
if sys.version_info[0] >= 3:
if isinstance(s,bytes):
return s
else:
return bytes(s,'ascii')
else:
return str(s)
def _bytes_to_str(b):
if sys.... | # coding: utf-8
from objc_util import *
from objc_util import parse_types
import ctypes
import inspect
import sys
def _str_to_bytes(s):
if sys.version_info[0] >= 3:
if isinstance(s,bytes):
return s
else:
return bytes(s,'ascii')
else:
return str(s)
def _bytes_to_str(b):
if sys.version_info[0] >= 3:
if ... | en | 0.89605 | # coding: utf-8 swizzles ObjCClass cls's selector with implementation from python new_fcn. new_fcn needs to adjere to ther type encoding of the original, including the two "hidden" arguments _self, _sel. if a class is already swizzled, this will override swizzled implemetation, and use new method. We could implemen... | 2.17461 | 2 |
src/__init__.py | Somsubhra/Simplify | 0 | 6621084 | __author__ = 's7a'
| __author__ = 's7a'
| none | 1 | 1.017905 | 1 | |
bazaar/templatetags/bazaar_management.py | meghabhoj/NEWBAZAAR | 0 | 6621085 | from __future__ import unicode_literals
from django import template
from ..listings.stores import stores_loader
register = template.Library()
@register.assignment_tag
def store_publishing_template(store_slug):
return stores_loader.get_store_strategy(store_slug).get_store_publishing_template()
@register.assig... | from __future__ import unicode_literals
from django import template
from ..listings.stores import stores_loader
register = template.Library()
@register.assignment_tag
def store_publishing_template(store_slug):
return stores_loader.get_store_strategy(store_slug).get_store_publishing_template()
@register.assig... | none | 1 | 1.893168 | 2 | |
src/loader/impl/__init__.py | William9923/IF4072-SentimentClassification | 0 | 6621086 | from src.loader.impl.dataloader import DataLoader | from src.loader.impl.dataloader import DataLoader | none | 1 | 1.168834 | 1 | |
triangular_lattice/fractal_dim_from_box_counting.py | ssh0/growing-string | 0 | 6621087 | <gh_stars>0
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# written by <NAME>
# 2017-01-27
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import SpanSelector
from optimize import Optimize_powerlaw
import time
def load_data(path):
data = np.load(path)
beta = data['beta']
num_o... | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# written by <NAME>
# 2017-01-27
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import SpanSelector
from optimize import Optimize_powerlaw
import time
def load_data(path):
data = np.load(path)
beta = data['beta']
num_of_strings = ... | en | 0.300253 | #!/usr/bin/env python # -*- coding:utf-8 -*- # # written by <NAME> # 2017-01-27 # Plot raw data # Plot averaged data # x_max のデータは除かれる? # Ls, N = averaging_data(Ls, N, N_r, scale='log') # save image # fn = "./results/img/fractal_dim/2017-01-27/raw_frames=%d_beta=%.0f" % (frames, beta) # fn += ".png" get specific condti... | 2.428102 | 2 |
backend_poa_admin/apps/prueba/views.py | lizethlizi/proyecto_backend_POA | 0 | 6621088 | from rest_framework.views import APIView
from rest_framework.response import Response
from django.shortcuts import get_object_or_404
from rest_framework import status
from .models import objetivo
from .serializers import ObjetivoSerializer
class ListaObjetivos(APIView):
def get(self, request):
Objetivo = ... | from rest_framework.views import APIView
from rest_framework.response import Response
from django.shortcuts import get_object_or_404
from rest_framework import status
from .models import objetivo
from .serializers import ObjetivoSerializer
class ListaObjetivos(APIView):
def get(self, request):
Objetivo = ... | es | 0.386899 | #medico=Medico.objects.all()[:20] # def post(self, request, id_medico): # Gestion=request.data.get("Gestion") # fecha = request.data.get("fecha") #medico como ide tiene q ir el mismo q con el que pusimos en el modelo # class ListaObjetivos(APIView): # """LISTA TODOS LOS REGISTROS""" # def get(self, request, for... | 2.16465 | 2 |
src/code/custom_callbacks.py | TerboucheHacene/StyleGAN-pytorch-lightining | 0 | 6621089 | <reponame>TerboucheHacene/StyleGAN-pytorch-lightining<filename>src/code/custom_callbacks.py
import torch
import torch.nn.functional as F
import torch.utils.data as tud
from pytorch_lightning.callbacks import Callback
from pytorch_lightning.utilities import rank_zero_only
from typing import List
from pytorch_lightning.u... | import torch
import torch.nn.functional as F
import torch.utils.data as tud
from pytorch_lightning.callbacks import Callback
from pytorch_lightning.utilities import rank_zero_only
from typing import List
from pytorch_lightning.utilities.cli import CALLBACK_REGISTRY
@CALLBACK_REGISTRY
class UpdateBatchSizeDataLoader(C... | en | 0.629711 | # set next depth | 2.234457 | 2 |
srcs/lcn.py | paozer/patent_classification | 0 | 6621090 | <gh_stars>0
from data_model_handling import import_data, get_level_data, TransformerPipeline
import os
import pandas as pd
import numpy as np
import math
import warnings
warnings.filterwarnings("ignore", category=FutureWarning)
warnings.filterwarnings("ignore", category=DeprecationWarning)
from sklearn.feature_extra... | from data_model_handling import import_data, get_level_data, TransformerPipeline
import os
import pandas as pd
import numpy as np
import math
import warnings
warnings.filterwarnings("ignore", category=FutureWarning)
warnings.filterwarnings("ignore", category=DeprecationWarning)
from sklearn.feature_extraction.text i... | en | 0.763877 | ParentNode This class represents a parent node in the classification hierarchy of a Local Classifier per Node (LCN) concept based on the definition of Silla and Freitas [1]. Besides carrying the name and level of the respective node, it serves as a container to save the data transformers for X and y data that a... | 2.051531 | 2 |
test/test_lincomb_bitwise.py | gxavier38/pysnark | 94 | 6621091 | <gh_stars>10-100
import pytest
from pysnark.runtime import PrivVal
from pysnark.boolean import LinCombBool
class TestLinCombBitwise():
def test_to_bits(self):
bits = PrivVal(5).to_bits()
assert bits[3].val() == 0
assert bits[2].val() == 1
assert bits[1].val() == 0
... | import pytest
from pysnark.runtime import PrivVal
from pysnark.boolean import LinCombBool
class TestLinCombBitwise():
def test_to_bits(self):
bits = PrivVal(5).to_bits()
assert bits[3].val() == 0
assert bits[2].val() == 1
assert bits[1].val() == 0
assert bits[0].va... | none | 1 | 2.562765 | 3 | |
test.py | LSaldyt/leaps_karel_standalone | 0 | 6621092 | from karel import *
print(dir())
print(dir(generator))
print(dir(karel))
print(dir(karel_supervised))
print(dir(util))
| from karel import *
print(dir())
print(dir(generator))
print(dir(karel))
print(dir(karel_supervised))
print(dir(util))
| none | 1 | 1.427277 | 1 | |
operaciones_list.py | MrInternauta/Python-apuntes | 0 | 6621093 | <reponame>MrInternauta/Python-apuntes
mi_lista = []
print(type(mi_lista))
mi_lista.append(1)
mi_lista2 = [2,3,4,5]
mi_lista3 = mi_lista + mi_lista2
print(mi_lista3)
mi_lista4 = ['a']
mi_lista5 = mi_lista4*10
print(mi_lista5)
#Modificar lista
lista = ['Juan', 'Pedro', 'Pepe']
lista[0] = 'Jose'
print(lista)... | mi_lista = []
print(type(mi_lista))
mi_lista.append(1)
mi_lista2 = [2,3,4,5]
mi_lista3 = mi_lista + mi_lista2
print(mi_lista3)
mi_lista4 = ['a']
mi_lista5 = mi_lista4*10
print(mi_lista5)
#Modificar lista
lista = ['Juan', 'Pedro', 'Pepe']
lista[0] = 'Jose'
print(lista)
#Eliminar elemento
del lista[0]
... | es | 0.311196 | #Modificar lista #Eliminar elemento #De String a lista #De string a lista #De Lista a String y viceversa #De string a lista | 3.789491 | 4 |
covews/data_access/preprocessing/custom_imputer.py | d909b/CovEWS | 16 | 6621094 | """
Copyright (C) 2020 <NAME>, <NAME> Ltd
Copyright (C) 2019 <NAME>, ETH Zurich
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 us... | """
Copyright (C) 2020 <NAME>, <NAME> Ltd
Copyright (C) 2019 <NAME>, ETH Zurich
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 us... | en | 0.734491 | Copyright (C) 2020 <NAME>, <NAME> Ltd Copyright (C) 2019 <NAME>, ETH Zurich 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, c... | 1.67527 | 2 |
crypto/coinapi/apps.py | aberrier/crypto-api-back | 0 | 6621095 | from django.apps import AppConfig
class CoinapiConfig(AppConfig):
name = 'coinapi'
| from django.apps import AppConfig
class CoinapiConfig(AppConfig):
name = 'coinapi'
| none | 1 | 1.233177 | 1 | |
backend/atlas/middleware/auth.py | getsentry/atlas | 18 | 6621096 | <reponame>getsentry/atlas
import logging
import sentry_sdk
from django.contrib.auth.models import AnonymousUser
from django.utils.functional import SimpleLazyObject
from atlas.models import User
from atlas.utils.auth import parse_token, security_hash
def get_user(header):
if not header.startswith("Token "):
... | import logging
import sentry_sdk
from django.contrib.auth.models import AnonymousUser
from django.utils.functional import SimpleLazyObject
from atlas.models import User
from atlas.utils.auth import parse_token, security_hash
def get_user(header):
if not header.startswith("Token "):
return AnonymousUser(... | none | 1 | 2.058265 | 2 | |
OpenCV/Tutorials/readImage.py | carlosfelgarcia/AITraining | 0 | 6621097 | <filename>OpenCV/Tutorials/readImage.py
'''
Created on Aug 3, 2018
@author: User
'''
import cv2
import numpy as np
import matplotlib.pyplot as ptl
img = cv2.imread('Utils/watch.jpg', cv2.IMREAD_GRAYSCALE)
# with CV2
cv2.imshow('image', img)
cv2.waitKey(0)
cv2.destroyAllWindows()
#With matplolib
#... | <filename>OpenCV/Tutorials/readImage.py
'''
Created on Aug 3, 2018
@author: User
'''
import cv2
import numpy as np
import matplotlib.pyplot as ptl
img = cv2.imread('Utils/watch.jpg', cv2.IMREAD_GRAYSCALE)
# with CV2
cv2.imshow('image', img)
cv2.waitKey(0)
cv2.destroyAllWindows()
#With matplolib
#... | en | 0.459573 | Created on Aug 3, 2018
@author: User # with CV2 #With matplolib # ptl.imshow(img, cmap='gray', interpolation='bicubic') # ptl.show() #Save | 3.372842 | 3 |
spider/DataBase.py | RaspPiTor/JAPPT | 0 | 6621098 | <reponame>RaspPiTor/JAPPT<filename>spider/DataBase.py
from contextlib import suppress
import json
import sys
import dbm
class DataBase(object):
'''A wrapper around the built in dbm library. This class uses json
to allow for non-string data to be stored in the database'''
def __init__(self, dbname, maxcache=10**... | from contextlib import suppress
import json
import sys
import dbm
class DataBase(object):
'''A wrapper around the built in dbm library. This class uses json
to allow for non-string data to be stored in the database'''
def __init__(self, dbname, maxcache=10**8):
'''Create a database using given database ... | en | 0.710763 | A wrapper around the built in dbm library. This class uses json to allow for non-string data to be stored in the database Create a database using given database name and use a cache with a specified maximium size Save all changes to file and clear the cache | 2.85281 | 3 |
tensorpipe/__init__.py | kartik4949/TensorPipe | 89 | 6621099 | <reponame>kartik4949/TensorPipe
import tensorpipe.augment
import tensorpipe.pipe
import tensorpipe.funnels
| import tensorpipe.augment
import tensorpipe.pipe
import tensorpipe.funnels | none | 1 | 1.005026 | 1 | |
CS2/8000_lunar_lander/lunar_lander_clean/ground.py | nealholt/python_programming_curricula | 7 | 6621100 | <reponame>nealholt/python_programming_curricula
import pygame, math
from constants import *
class Ground:
def __init__(self, surface):
self.surface = surface
self.ground_heights = [[0,0],[200,700],[400,200],[600,550],
[800,0],[1000,300],[1200,800],[1400,400],
... | import pygame, math
from constants import *
class Ground:
def __init__(self, surface):
self.surface = surface
self.ground_heights = [[0,0],[200,700],[400,200],[600,550],
[800,0],[1000,300],[1200,800],[1400,400],
[1600,600],[1650,600],#Land... | en | 0.933276 | #Landing pad start and end Use this to figure out trajectory to the pad. #Check that the player is facing upright, and #has minimal dx and sufficiently small dy for a safe landing. #Get coordinates that x is between and use those coordinates #as a line to calculate the height of the ground at that x value. #Point slope... | 3.423926 | 3 |
src/plot/plot_net.py | Zimiao1025/Sesica | 0 | 6621101 | from random import sample
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
# Gold standard data of positive gene functional associations
# from https://www.inetbio.org/wormnet/downloadnetwork.php
# G = nx.read_edgelist("WormNet.v3.benchmark.txt")
def net_fig(txt_file, fig_path):
G = nx.rea... | from random import sample
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
# Gold standard data of positive gene functional associations
# from https://www.inetbio.org/wormnet/downloadnetwork.php
# G = nx.read_edgelist("WormNet.v3.benchmark.txt")
def net_fig(txt_file, fig_path):
G = nx.rea... | en | 0.491009 | # Gold standard data of positive gene functional associations # from https://www.inetbio.org/wormnet/downloadnetwork.php # G = nx.read_edgelist("WormNet.v3.benchmark.txt") # G = nx.read_edgelist("pos_homo_pairs.txt") # remove randomly selected nodes (to make example fast) # remove low-degree nodes # print(list(G.edges(... | 2.736976 | 3 |
docs/api/escape_latex.py | tzole1155/moai | 10 | 6621102 | <filename>docs/api/escape_latex.py
__SYMBOL_MAP__ = {
# '!': '%21',
'#': '%23',
'$': '%24',
'%': '%25',
'&': '%26',
'\'': '%27',
'(': '%28',
')': '%29',
'*': '%2A',
'+': '%2B',
',': '%2C',
'/': '%2F',
':': '%3A',
';': '%3B',
'=': '%3D',
'?': '%3F',
'@... | <filename>docs/api/escape_latex.py
__SYMBOL_MAP__ = {
# '!': '%21',
'#': '%23',
'$': '%24',
'%': '%25',
'&': '%26',
'\'': '%27',
'(': '%28',
')': '%29',
'*': '%2A',
'+': '%2B',
',': '%2C',
'/': '%2F',
':': '%3A',
';': '%3B',
'=': '%3D',
'?': '%3F',
'@... | en | 0.281094 | # '!': '%21', #NOTE: https://gist.github.com/a-rodin/fef3f543412d6e1ec5b6cf55bf197d7b | 2.118835 | 2 |
ares/util/ParameterBundles.py | astrojhgu/ares | 1 | 6621103 | <gh_stars>1-10
"""
ParameterBundles.py
Author: <NAME>
Affiliation: UCLA
Created on: Fri Jun 10 11:00:05 PDT 2016
Description:
"""
import numpy as np
from .ReadData import read_lit
from .ParameterFile import pop_id_num
from .ProblemTypes import ProblemType
from .PrintInfo import header, footer, separator, line
de... | """
ParameterBundles.py
Author: <NAME>
Affiliation: UCLA
Created on: Fri Jun 10 11:00:05 PDT 2016
Description:
"""
import numpy as np
from .ReadData import read_lit
from .ParameterFile import pop_id_num
from .ProblemTypes import ProblemType
from .PrintInfo import header, footer, separator, line
def _add_pop_tag(... | en | 0.700436 | ParameterBundles.py Author: <NAME> Affiliation: UCLA Created on: Fri Jun 10 11:00:05 PDT 2016 Description: Add a population ID tag to each parameter. # Redshift dependent parameters here # Emits LW and LyC # Stellar pop + fesc # Emits X-rays # Some different spectral models # data should be a string # Clear out # Ass... | 2.233097 | 2 |
kotlang/kotc_main.py | jstasiak/kotlang | 1 | 6621104 | #!/usr/bin/env python3
import contextlib
import os
import subprocess
import sys
import time
from typing import cast, IO, Iterator, Optional
import click
from llvmlite import binding as llvm, ir
from kotlang.context import Context
class Emitter:
def __init__(self, optimization_level: Optional[int] = None) -> Non... | #!/usr/bin/env python3
import contextlib
import os
import subprocess
import sys
import time
from typing import cast, IO, Iterator, Optional
import click
from llvmlite import binding as llvm, ir
from kotlang.context import Context
class Emitter:
def __init__(self, optimization_level: Optional[int] = None) -> Non... | en | 0.738287 | #!/usr/bin/env python3 # All these initializations are required for code generation! # Create a target machine representing the host # TODO: bring back declaring what libraries should we link with # *(f'-l{library}' for library in ...), | 2.10469 | 2 |
setup.py | ofey404/MPS060602 | 0 | 6621105 | """
Setup file for MPS060602.
Use setup.cfg to configure your project.
This file was generated with PyScaffold 4.1.5.
PyScaffold helps you to put up the scaffold of your new Python project.
Learn more under: https://pyscaffold.org/
"""
from setuptools import setup
from sys import platform
if __nam... | """
Setup file for MPS060602.
Use setup.cfg to configure your project.
This file was generated with PyScaffold 4.1.5.
PyScaffold helps you to put up the scaffold of your new Python project.
Learn more under: https://pyscaffold.org/
"""
from setuptools import setup
from sys import platform
if __nam... | en | 0.926968 | Setup file for MPS060602. Use setup.cfg to configure your project. This file was generated with PyScaffold 4.1.5. PyScaffold helps you to put up the scaffold of your new Python project. Learn more under: https://pyscaffold.org/ # noqa | 1.958157 | 2 |
src/main/nluas/language/ntuple_visualizer.py | icsi-berkeley/framework-code | 2 | 6621106 | <reponame>icsi-berkeley/framework-code<gh_stars>1-10
"""
@author: <<EMAIL>
A simple program to output n-tuples using Analyzer+Specializer. Not reliant on any packages other than Jython.
"""
from nluas.language.core_specializer import *
from nluas.ntuple_decoder import *
import traceback
import pprint
from six.mov... | """
@author: <<EMAIL>
A simple program to output n-tuples using Analyzer+Specializer. Not reliant on any packages other than Jython.
"""
from nluas.language.core_specializer import *
from nluas.ntuple_decoder import *
import traceback
import pprint
from six.moves import input
decoder = NtupleDecoder()
analyzer ... | en | 0.403683 | @author: <<EMAIL> A simple program to output n-tuples using Analyzer+Specializer. Not reliant on any packages other than Jython. #decoder.pprint_ntuple(ntuple) #print(ntuple) | 2.716185 | 3 |
hw2_classification.py | mariamingallonMM/AI-ML-W6-classifier | 1 | 6621107 | """
This code implements a k-class Classifier per week 6 assignment of the machine learning module part of Columbia University Micromaster programme in AI.
Written using Python 3.X for running on Vocareum
Execute as follows:
$ python3 hw2_classification.py X_train.csv y_train.csv X_test.csv
"""
# builtin modules
fro... | """
This code implements a k-class Classifier per week 6 assignment of the machine learning module part of Columbia University Micromaster programme in AI.
Written using Python 3.X for running on Vocareum
Execute as follows:
$ python3 hw2_classification.py X_train.csv y_train.csv X_test.csv
"""
# builtin modules
fro... | en | 0.836801 | This code implements a k-class Classifier per week 6 assignment of the machine learning module part of Columbia University Micromaster programme in AI. Written using Python 3.X for running on Vocareum Execute as follows: $ python3 hw2_classification.py X_train.csv y_train.csv X_test.csv # builtin modules #import psut... | 4.13598 | 4 |
software/archived/utils/cameraSetup.py | luzgool/ReachMaster | 2 | 6621108 | from ximea import xiapi
import numpy as np
class cameraDev():
#Initialize all camera devices to user defined camera settings
def __init__(self,num_cams,camSetDict,init_time):
self.cameraList = []
self.init_time = init_time
for i in range(num_cams):
camera = xiapi.Camera(dev_id = i)
#start communication
... | from ximea import xiapi
import numpy as np
class cameraDev():
#Initialize all camera devices to user defined camera settings
def __init__(self,num_cams,camSetDict,init_time):
self.cameraList = []
self.init_time = init_time
for i in range(num_cams):
camera = xiapi.Camera(dev_id = i)
#start communication
... | en | 0.850208 | #Initialize all camera devices to user defined camera settings #start communication #Prints the settings of each camera | 2.428879 | 2 |
auto_surprise/strategies/base.py | BeelGroup/Auto-Surprise | 23 | 6621109 | <gh_stars>10-100
from auto_surprise.constants import DEFAULT_MAX_EVALS, DEFAULT_HPO_ALGO
class StrategyBase:
def __init__(
self,
algorithms,
data,
target_metric,
baseline_loss,
temporary_directory,
time_limit=None,
max_evals=DEFAULT_MAX_EVALS,
... | from auto_surprise.constants import DEFAULT_MAX_EVALS, DEFAULT_HPO_ALGO
class StrategyBase:
def __init__(
self,
algorithms,
data,
target_metric,
baseline_loss,
temporary_directory,
time_limit=None,
max_evals=DEFAULT_MAX_EVALS,
hpo_algo=DEFAUL... | none | 1 | 1.967068 | 2 | |
src/filecrawl.py | pik-software/pst-extraction | 35 | 6621110 | #! /usr/bin/env python2.7
# -*- coding: utf-8 -*-
import argparse
import sys
import os
import json
import time
import mimetypes
import dateutil.parser
import dateutil.tz
import itertools
import collections
import datetime
import uuid
import traceback
sys.path.append("./utils")
from utils.file import slurpBase64, R... | #! /usr/bin/env python2.7
# -*- coding: utf-8 -*-
import argparse
import sys
import os
import json
import time
import mimetypes
import dateutil.parser
import dateutil.tz
import itertools
import collections
import datetime
import uuid
import traceback
sys.path.append("./utils")
from utils.file import slurpBase64, R... | en | 0.27532 | #! /usr/bin/env python2.7 # -*- coding: utf-8 -*- # filename, ext = os.path.splitext(file) examples: ./filecrawl.py {files_directory} output_path | 2.187081 | 2 |
TORO/libs/toro/model.py | IDA-TUBS/TORO | 2 | 6621111 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Toro
| Copyright (C) 2021 Institute of Computer and Network Engineering (IDA) at TU BS
| All rights reserved.
| See LICENSE file for copyright and license details.
:Authors:
- <NAME>
- <NAME>
- <NAME>
- <NAME>
Description
---------... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Toro
| Copyright (C) 2021 Institute of Computer and Network Engineering (IDA) at TU BS
| All rights reserved.
| See LICENSE file for copyright and license details.
:Authors:
- <NAME>
- <NAME>
- <NAME>
- <NAME>
Description
---------... | en | 0.819204 | #!/usr/bin/env python # -*- coding: utf-8 -*- Toro | Copyright (C) 2021 Institute of Computer and Network Engineering (IDA) at TU BS | All rights reserved. | See LICENSE file for copyright and license details. :Authors: - <NAME> - <NAME> - <NAME> - <NAME> Description ----------- Pa... | 2.25918 | 2 |
fitgrid/errors.py | turbach/fitgrid | 0 | 6621112 | class FitGridError(Exception):
pass
| class FitGridError(Exception):
pass
| none | 1 | 1.096742 | 1 | |
test/test_vocab.py | ulf1/nlptasks | 2 | 6621113 | from nlptasks.vocab import (
identify_vocab_mincount, texttoken_to_index)
def test1():
data = ["abc", "abc", "abc", "def", "def", "ghi"]
min_occurrences = 2
VOCAB = identify_vocab_mincount(data, min_occurrences)
assert "abc" in VOCAB
assert "def" in VOCAB
assert "ghi" not in VOCAB
asse... | from nlptasks.vocab import (
identify_vocab_mincount, texttoken_to_index)
def test1():
data = ["abc", "abc", "abc", "def", "def", "ghi"]
min_occurrences = 2
VOCAB = identify_vocab_mincount(data, min_occurrences)
assert "abc" in VOCAB
assert "def" in VOCAB
assert "ghi" not in VOCAB
asse... | none | 1 | 3.036286 | 3 | |
example.py | mavnt/d | 0 | 6621114 | <filename>example.py
import json
import time
from d import d
def main():
time_ = time.time()
user1 = {
"name": "John",
"surname": "Smith",
"age": 99,
"data": [1, 2, 3, 5],
}
user2 = {
"name": "John",
"surname": "Smith",
"age": 99,
"data"... | <filename>example.py
import json
import time
from d import d
def main():
time_ = time.time()
user1 = {
"name": "John",
"surname": "Smith",
"age": 99,
"data": [1, 2, 3, 5],
}
user2 = {
"name": "John",
"surname": "Smith",
"age": 99,
"data"... | none | 1 | 3.117307 | 3 | |
allennlp/tango/text_only.py | ksteimel/allennlp | 11,433 | 6621115 | <reponame>ksteimel/allennlp
"""
*AllenNLP Tango is an experimental API and parts of it might change or disappear
every time we release a new version.*
"""
import dataclasses
from typing import Set, Optional, Iterable, Any
from allennlp.tango.dataset import DatasetDict
from allennlp.tango.step import Step
@Step.regi... | """
*AllenNLP Tango is an experimental API and parts of it might change or disappear
every time we release a new version.*
"""
import dataclasses
from typing import Set, Optional, Iterable, Any
from allennlp.tango.dataset import DatasetDict
from allennlp.tango.step import Step
@Step.register("text_only")
class Text... | en | 0.871338 | *AllenNLP Tango is an experimental API and parts of it might change or disappear every time we release a new version.* This step converts a dataset into another dataset that contains only the strings from the original dataset. You can specify exactly which fields to keep from the original dataset (default is all o... | 3.001869 | 3 |
subject_classification_spanish/__init__.py | news-scrapers/subject-classification-spanish | 3 | 6621116 | <gh_stars>1-10
from . import subject_classifier
| from . import subject_classifier | none | 1 | 1.035449 | 1 | |
Chapter06/dataclass_stocks.py | 4n3i5v74/Python-3-Object-Oriented-Programming-Third-Edition | 393 | 6621117 | from dataclasses import make_dataclass, dataclass
# using make_dataclass
Stock = make_dataclass("Stock", ["symbol", "current", "high", "low"])
stock = Stock("FB", 177.46, high=178.67, low=175.79)
# compared to regular object
class StockRegClass:
def __init__(self, name, current, high, low):
self.name = n... | from dataclasses import make_dataclass, dataclass
# using make_dataclass
Stock = make_dataclass("Stock", ["symbol", "current", "high", "low"])
stock = Stock("FB", 177.46, high=178.67, low=175.79)
# compared to regular object
class StockRegClass:
def __init__(self, name, current, high, low):
self.name = n... | en | 0.537498 | # using make_dataclass # compared to regular object # using dataclass decorator | 3.651716 | 4 |
tests/test_feed_download.py | martineian/act-scio2 | 2 | 6621118 | <filename>tests/test_feed_download.py
""" test feed download """
from act.scio.feeds import extract
def test_safe_download() -> None:
""" test for safe download """
assert extract.safe_filename("test%.[x y z]") == "test.x_y_z"
| <filename>tests/test_feed_download.py
""" test feed download """
from act.scio.feeds import extract
def test_safe_download() -> None:
""" test for safe download """
assert extract.safe_filename("test%.[x y z]") == "test.x_y_z"
| en | 0.823029 | test feed download test for safe download | 1.911661 | 2 |
app/trainaclass_views.py | aroranipun04/CloudCV-Old | 11 | 6621119 | __author__ = 'clint'
import time
import os
import json
import traceback
from django.views.generic import CreateView, DeleteView
from django.http import HttpResponse, HttpResponseRedirect
from django.views.decorators.csrf import csrf_exempt
from PIL import Image
from querystring_parser import parser
import redis
fro... | __author__ = 'clint'
import time
import os
import json
import traceback
from django.views.generic import CreateView, DeleteView
from django.http import HttpResponse, HttpResponseRedirect
from django.views.decorators.csrf import csrf_exempt
from PIL import Image
from querystring_parser import parser
import redis
fro... | en | 0.530375 | # SET OF PATH CONSTANTS - SOME UNUSED # File initially downloaded here # Input image is saved here (symbolic links) - after resizing to 500 x 500 This function created the view and validates the form. It adds images to a new label. Makes directory and save them. # fcountfile = open(os.path.join(conf.LOG_DIR, 'l... | 2.032206 | 2 |
utils.py | narumiruna/pytorch-wgangp | 3 | 6621120 | import os
from bokeh import plotting
class AverageMeter(object):
def __init__(self):
self.sum = 0
self.count = 0
self.average = None
def update(self, value, number=1):
self.sum += value * number
self.count += number
self.average = self.sum / se... | import os
from bokeh import plotting
class AverageMeter(object):
def __init__(self):
self.sum = 0
self.count = 0
self.average = None
def update(self, value, number=1):
self.sum += value * number
self.count += number
self.average = self.sum / se... | none | 1 | 2.958379 | 3 | |
Systems/Engine/Scene.py | RippeR37/PyPong | 1 | 6621121 | <reponame>RippeR37/PyPong
class Scene(object):
def __init__(self, stackable=True, stack_usable=True):
self._is_stackable = stackable
self._is_stack_usable = stack_usable
def is_stackable(self):
return self._is_stackable
def is_stack_usable(self):
return self._is_stack_usab... | class Scene(object):
def __init__(self, stackable=True, stack_usable=True):
self._is_stackable = stackable
self._is_stack_usable = stack_usable
def is_stackable(self):
return self._is_stackable
def is_stack_usable(self):
return self._is_stack_usable
def update(self, dt... | none | 1 | 2.498118 | 2 | |
jeff/utils.py | JeffJerseyCow/jeff | 8 | 6621122 | import re
import os
import json
import importlib
import subprocess
def checkDocker():
"""Checks docker is installed and user is a member of the docker group.
Returns:
True if docker is installed and user is a member of the docker group
else False.
"""
try:
cmdArgs = ['docker', ... | import re
import os
import json
import importlib
import subprocess
def checkDocker():
"""Checks docker is installed and user is a member of the docker group.
Returns:
True if docker is installed and user is a member of the docker group
else False.
"""
try:
cmdArgs = ['docker', ... | en | 0.692148 | Checks docker is installed and user is a member of the docker group. Returns: True if docker is installed and user is a member of the docker group else False. Loads the jeff confgiruation file. Returns: The jeff configuration file as a dictionary else False. Loads jeff plugins specifie... | 2.613583 | 3 |
local_file_courier_py/sendFiles.py | sairash/local_file_courier | 1 | 6621123 | <gh_stars>1-10
from tkinter import *
from tkinter import ttk
from tkinter import filedialog
import os
import random
import socket
listPlace = 0
def get_folder_path():
folder_selected = filedialog.askdirectory()
if folder_selected == '':
get_folder_path()
else:
folderPath.set(folder_select... | from tkinter import *
from tkinter import ttk
from tkinter import filedialog
import os
import random
import socket
listPlace = 0
def get_folder_path():
folder_selected = filedialog.askdirectory()
if folder_selected == '':
get_folder_path()
else:
folderPath.set(folder_selected)
# print... | ru | 0.120531 | # print(folderPath.get().split('/')[-1]) | 3.10647 | 3 |
backend/forum/base/apps.py | karolyi/forum-django | 7 | 6621124 | <reponame>karolyi/forum-django
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class BaseConfig(AppConfig):
name = 'forum.base'
verbose_name = _('Forum: Base')
label = 'forum_base'
| from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class BaseConfig(AppConfig):
name = 'forum.base'
verbose_name = _('Forum: Base')
label = 'forum_base' | none | 1 | 1.399315 | 1 | |
client/spot.py | ronpandolfi/Xi-cam | 19 | 6621125 | # -*- coding: utf-8 -*-
import os
from time import sleep
from StringIO import StringIO
from PIL import Image
import numpy as np
from client.newt import NewtClient
class SpotClient(NewtClient):
"""
Client class to handle SPOT API calls
"""
BASE_DIR = '/global/project/projectdirs/als/spade/warehouse'
... | # -*- coding: utf-8 -*-
import os
from time import sleep
from StringIO import StringIO
from PIL import Image
import numpy as np
from client.newt import NewtClient
class SpotClient(NewtClient):
"""
Client class to handle SPOT API calls
"""
BASE_DIR = '/global/project/projectdirs/als/spade/warehouse'
... | en | 0.578605 | # -*- coding: utf-8 -*- Client class to handle SPOT API calls Login to SPOT Parameters ---------- username : str password : str Search a dataset on SPOT Parameters ---------- query : str, search query kwargs : {key: option} Any of the followi... | 2.839045 | 3 |
lkmltools/linter/rule_factory.py | iserko/lookml-tools | 0 | 6621126 | """
a rule factory
Authors:
<NAME> (<EMAIL>)
"""
from lkmltools.linter.rules.filerules.one_view_per_file_rule import OneViewPerFileRule
from lkmltools.linter.rules.filerules.filename_viewname_match_rule import (
FilenameViewnameMatchRule,
)
from lkmltools.linter.rules.filerules.data_source_rule imp... | """
a rule factory
Authors:
<NAME> (<EMAIL>)
"""
from lkmltools.linter.rules.filerules.one_view_per_file_rule import OneViewPerFileRule
from lkmltools.linter.rules.filerules.filename_viewname_match_rule import (
FilenameViewnameMatchRule,
)
from lkmltools.linter.rules.filerules.data_source_rule imp... | en | 0.758421 | a rule factory Authors: <NAME> (<EMAIL>) Singleton Factory where one can register Rules for instantiation instantiate the factory but as a singleton. The guard rails are here # where the magic happens, only one instance allowed: getattr with instance name Returns: gettattr actual facto... | 2.346474 | 2 |
interview/leet/41_First_Missing_Positive.py | eroicaleo/LearningPython | 1 | 6621127 | <reponame>eroicaleo/LearningPython
#!/usr/bin/env python
# The thinking process is like the following:
# 1. remove O(n) space limit, then we can use a hash table to solve it
# 2. then the hash table is not necessary, can modify the original array
class Solution:
def firstMissingPositive(self, nums):
"""
... | #!/usr/bin/env python
# The thinking process is like the following:
# 1. remove O(n) space limit, then we can use a hash table to solve it
# 2. then the hash table is not necessary, can modify the original array
class Solution:
def firstMissingPositive(self, nums):
"""
:type nums: List[int]
... | en | 0.612696 | #!/usr/bin/env python # The thinking process is like the following: # 1. remove O(n) space limit, then we can use a hash table to solve it # 2. then the hash table is not necessary, can modify the original array :type nums: List[int] :rtype: int | 3.549221 | 4 |
src/ais_toy/classical_search/graph_search.py | smastelini/ai-search-toy-examples | 0 | 6621128 | <filename>src/ais_toy/classical_search/graph_search.py
class GraphSearch:
def __init__(self, graph):
self._graph = graph
def _prepare(self):
self._opened = []
self._closed = []
def search(self, origin, dest):
pass
| <filename>src/ais_toy/classical_search/graph_search.py
class GraphSearch:
def __init__(self, graph):
self._graph = graph
def _prepare(self):
self._opened = []
self._closed = []
def search(self, origin, dest):
pass
| none | 1 | 2.181977 | 2 | |
python/setup.py | tannercrook/Canvas-to-Infinite-Campus-Grade-Sync | 1 | 6621129 | <gh_stars>1-10
import server as s
import functions as f
import accounts as a
import os
import json
def mainMenu():
"""
Displays the main menu of the setup script.
"""
os.system('cls' if os.name == 'nt' else 'clear')
print('Main Menu')
print('1 - Set Canvas Instance URL')
print('2 - Set Di... | import server as s
import functions as f
import accounts as a
import os
import json
def mainMenu():
"""
Displays the main menu of the setup script.
"""
os.system('cls' if os.name == 'nt' else 'clear')
print('Main Menu')
print('1 - Set Canvas Instance URL')
print('2 - Set District Account ... | en | 0.653326 | Displays the main menu of the setup script. # Removes the trailing space from the path. Writes the variables.json file. Sets the Canvas URL variable. Sets the Canvas district account id variable. This is the base account id for your Canvas instance. Sets the Canvas access token. Sets the Canvas sub accounts from wh... | 3.082471 | 3 |
prophy/tests/test_union.py | florczakraf/prophy | 14 | 6621130 | import prophy
import pytest
@pytest.fixture(scope='session')
def SimpleUnion():
class SimpleUnion(prophy.with_metaclass(prophy.union_generator, prophy.union)):
_descriptor = [("a", prophy.u32, 0),
("b", prophy.u32, 1),
("c", prophy.u32, 2)]
return SimpleU... | import prophy
import pytest
@pytest.fixture(scope='session')
def SimpleUnion():
class SimpleUnion(prophy.with_metaclass(prophy.union_generator, prophy.union)):
_descriptor = [("a", prophy.u32, 0),
("b", prophy.u32, 1),
("c", prophy.u32, 2)]
return SimpleU... | gl | 0.373091 | \ a: 10 b { a: 1024 } c: 32 \ a { b: 1 } a { c: 2 } \ b { a: 6 b: 7 } \ b { a { a: 7 } a { a: 8 } a { a: 9 } } \ a { b: 8 } \ b: E_1 \ a: '\\x01\\x02\\x03' | 2.317574 | 2 |
AppLatencyExperiments/main.py | andres0sorio/AODS4AWork | 1 | 6621131 | from src.Experiment import Experiment
if __name__ == '__main__':
"""
"""
experiment = Experiment()
experiment.run()
| from src.Experiment import Experiment
if __name__ == '__main__':
"""
"""
experiment = Experiment()
experiment.run()
| none | 1 | 1.202916 | 1 | |
pass.py | itzjustalan/pass | 2 | 6621132 | <gh_stars>1-10
import random # for random obviously
import subprocess #for clipboard also apparently XD
#alan k john
caps = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
small = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ... | import random # for random obviously
import subprocess #for clipboard also apparently XD
#alan k john
caps = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
small = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', ... | en | 0.799199 | # for random obviously #for clipboard also apparently XD #alan k john #numbs = list(range(0,10)) #does the same thing #print(*splespce, sep='') #to print it continuously like a string # initialising passw #cuz we want 16 digits # print(b) #pulls a random element fro... | 3.117918 | 3 |
tests/test_LookupTable2.py | jwilso/sst-core | 77 | 6621133 | <filename>tests/test_LookupTable2.py
import sst
import inspect, os, sys
nitems = 10
params = dict({
"num_entities" : nitems
})
for i in range(nitems):
comp = sst.Component("Table Comp %d"%i, "coreTestElement.simpleLookupTableComponent")
comp.addParams(params)
comp.addParam("myid", i)
| <filename>tests/test_LookupTable2.py
import sst
import inspect, os, sys
nitems = 10
params = dict({
"num_entities" : nitems
})
for i in range(nitems):
comp = sst.Component("Table Comp %d"%i, "coreTestElement.simpleLookupTableComponent")
comp.addParams(params)
comp.addParam("myid", i)
| none | 1 | 2.22717 | 2 | |
coh-metrix_3/09_tangozyouhou.py | Lee-guccii/ExtensiveReading_YL_Estimation | 0 | 6621134 | <reponame>Lee-guccii/ExtensiveReading_YL_Estimation
import nltk
import numpy as np
import re
from scipy import stats
from scipy.stats import spearmanr
import spacy
from functools import lru_cache
import en_core_web_lg
nlp = en_core_web_lg.load()
#親やすさdicを作成する
###############
#textをnew_listに読み込む
with open("tango_sit... | import nltk
import numpy as np
import re
from scipy import stats
from scipy.stats import spearmanr
import spacy
from functools import lru_cache
import en_core_web_lg
nlp = en_core_web_lg.load()
#親やすさdicを作成する
###############
#textをnew_listに読み込む
with open("tango_sitasimiyasusa_list.txt", "r", encoding="utf-8") as f:
... | ja | 0.945648 | #親やすさdicを作成する ############### #textをnew_listに読み込む ##################################### #使いたいパラメータの数字を取り出す→相関の確認 #単語名,親やすさ(100:親しみがない,700:親しみがある) #値を取り出す #単語名 #数値 #文字列を数値に変換 #改行("\n")を""に変換 #text_list = f.read().splitlines() #正規表現で"を削除 #[0]=元の文字,[1]=品詞タグ #品詞の名前 #品詞の個数.配列は品詞の名前と対応している. #総単語数に数えない記号 #内容語の品詞 #naiyougo_lis... | 2.818258 | 3 |
piston/post.py | ausbitbank/piston | 0 | 6621135 | <reponame>ausbitbank/piston
import warnings
from steem.post import Post as PostSteem
from steem.post import (
VotingInvalidOnArchivedPost
)
class Post(PostSteem):
def __init__(self, *args, **kwargs):
warnings.warn(
"[DeprecationWarning] Please replace 'import piston.post' by 'import steem.... | import warnings
from steem.post import Post as PostSteem
from steem.post import (
VotingInvalidOnArchivedPost
)
class Post(PostSteem):
def __init__(self, *args, **kwargs):
warnings.warn(
"[DeprecationWarning] Please replace 'import piston.post' by 'import steem.post'"
)
sup... | none | 1 | 2.224481 | 2 | |
flow/transformations.py | li012589/NeuralWavelet | 28 | 6621136 | <filename>flow/transformations.py
import torch
from torch import nn
from .flow import Flow
class ScalingNshifting(Flow):
def __init__(self, scaling, shifting, name="ScalingNshifting"):
super(ScalingNshifting, self).__init__(None, name)
self.scaling = nn.Parameter(torch.tensor(scaling).float(), req... | <filename>flow/transformations.py
import torch
from torch import nn
from .flow import Flow
class ScalingNshifting(Flow):
def __init__(self, scaling, shifting, name="ScalingNshifting"):
super(ScalingNshifting, self).__init__(None, name)
self.scaling = nn.Parameter(torch.tensor(scaling).float(), req... | en | 0.842465 | # to decimal # to int | 2.757917 | 3 |
command/main.py | Canon11/dj-cref | 1 | 6621137 | <filename>command/main.py<gh_stars>1-10
import argparse
from .runner import (
View, FormView, CreateView, UpdateView, DetailView,
DeleteView, TemplateView, ListView, RedirectView
)
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
'-type', type=str, help='the type of django g... | <filename>command/main.py<gh_stars>1-10
import argparse
from .runner import (
View, FormView, CreateView, UpdateView, DetailView,
DeleteView, TemplateView, ListView, RedirectView
)
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
'-type', type=str, help='the type of django g... | none | 1 | 2.527437 | 3 | |
makodedit/file_manage.py | Eleven-junichi2/mamo | 1 | 6621138 | from abc import ABCMeta, abstractmethod
from kivy.uix.relativelayout import RelativeLayout
from kivy.properties import ObjectProperty
from kivy.uix.popup import Popup
class FileBrowserDialogLayout(RelativeLayout):
file_manage_user = ObjectProperty(None)
file_manager = ObjectProperty(None)
popup = ObjectP... | from abc import ABCMeta, abstractmethod
from kivy.uix.relativelayout import RelativeLayout
from kivy.properties import ObjectProperty
from kivy.uix.popup import Popup
class FileBrowserDialogLayout(RelativeLayout):
file_manage_user = ObjectProperty(None)
file_manager = ObjectProperty(None)
popup = ObjectP... | en | 0.365635 | Example usage: class ExampleFileManager(FileManager): def load_file(self): pass def save_file(self): pass class ExampleFileManageUser(Widget): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.file_manager = Exa... | 2.434105 | 2 |
models/BayesianModels/Bayesian3Conv3FC.py | SuperBruceJia/EEG-BayesianCNN | 21 | 6621139 | import math
import torch
import torch.nn as nn
from layers.BBBConv import BBBConv2d
from layers.BBBLinear import BBBLinear
from layers.misc import FlattenLayer, ModuleWrapper
class BBB3Conv3FC(ModuleWrapper):
"""
Simple Neural Network having 3 Convolution
and 3 FC layers with Bayesian layers.
... | import math
import torch
import torch.nn as nn
from layers.BBBConv import BBBConv2d
from layers.BBBLinear import BBBLinear
from layers.misc import FlattenLayer, ModuleWrapper
class BBB3Conv3FC(ModuleWrapper):
"""
Simple Neural Network having 3 Convolution
and 3 FC layers with Bayesian layers.
... | en | 0.33881 | Simple Neural Network having 3 Convolution
and 3 FC layers with Bayesian layers. # # self.fc3 = BBBLinear(256, 128, alpha_shape=(1, 1), bias=True, name='fc3') # self.fc3_bn = nn.BatchNorm1d(128) # self.fc3_activate = nn.Softplus() # self.fc3_dropout = nn.Dropout(p=0.50) # # self.fc4 = BBBLinear(128, 64, alpha_shap... | 2.833926 | 3 |
main.py | janhenrikbern/VT_OPT | 2 | 6621140 | <gh_stars>1-10
import matplotlib.pyplot as plt
import numpy as np
import argparse
from track import load_track
from vehicles import PointCar
import viterbi
import path_finding
from scoring_functions import (
time_score,
distance_score,
centerline_score
)
import metrics
import optimal
parser = argparse.Arg... | import matplotlib.pyplot as plt
import numpy as np
import argparse
from track import load_track
from vehicles import PointCar
import viterbi
import path_finding
from scoring_functions import (
time_score,
distance_score,
centerline_score
)
import metrics
import optimal
parser = argparse.ArgumentParser()
p... | en | 0.345402 | # Set to a valid point in trajectory # Set to a valid point in trajectory # Set to a valid point in trajectory # min_distance() # min_time() # IMG_PATH = "./tracks/loop.png" # track = load_track(IMG_PATH) # # Set to a valid point in trajectory # starting_position = (150., 200.) # car = PointCar(*starting_position) # ba... | 2.510123 | 3 |
xmas/lib/logger.py | pikesley/christmas-pixels | 0 | 6621141 | <reponame>pikesley/christmas-pixels<gh_stars>0
import logging
LOGGER = logging.getLogger('christmas-pixels')
LOGGER.setLevel(logging.INFO)
LOGGER.addHandler(logging.StreamHandler())
def disable():
"""Switch logging off because it messes up the test output."""
LOGGER.setLevel(logging.CRITICAL)
| import logging
LOGGER = logging.getLogger('christmas-pixels')
LOGGER.setLevel(logging.INFO)
LOGGER.addHandler(logging.StreamHandler())
def disable():
"""Switch logging off because it messes up the test output."""
LOGGER.setLevel(logging.CRITICAL) | en | 0.724761 | Switch logging off because it messes up the test output. | 2.561223 | 3 |
9. Um pouco mais sobre strings/quantos_dias_se_passaram.py | andrebrito16/python-academy | 1 | 6621142 | def dias_do_ano(data):
dia = int(data[:2])
mes = int(data[3:5])
ind_mes = mes-1
ano = data[6:]
meses = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
# Calcular os dias até o mês anterior
if mes == 1:
return dia -1
total = 0
for c in range(0, ind_mes):
total += meses[c]
return tot... | def dias_do_ano(data):
dia = int(data[:2])
mes = int(data[3:5])
ind_mes = mes-1
ano = data[6:]
meses = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
# Calcular os dias até o mês anterior
if mes == 1:
return dia -1
total = 0
for c in range(0, ind_mes):
total += meses[c]
return tot... | pt | 0.993581 | # Calcular os dias até o mês anterior | 3.606177 | 4 |
scraper/storage_spiders/zenocomvn.py | chongiadung/choinho | 0 | 6621143 | <reponame>chongiadung/choinho<filename>scraper/storage_spiders/zenocomvn.py<gh_stars>0
# Auto generated by generator.py. Delete this line if you make modification.
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//div[@class='t_ctsp21']/div[@class='t_ctsp1']/div/... | # Auto generated by generator.py. Delete this line if you make modification.
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//div[@class='t_ctsp21']/div[@class='t_ctsp1']/div/h1",
'price' : "//b[@style='color: #b50000;']|//b[@style='color: #ff0000;font-size:... | en | 0.519191 | # Auto generated by generator.py. Delete this line if you make modification. #b50000;']|//b[@style='color: #ff0000;font-size: 20px;']", #Rule(LinkExtractor(), 'parse_item_and_links'), | 2.066622 | 2 |
scripts/05_modules/bodypaint/get_uv_seams_s22_114.py | PluginCafe/cinema4d_py_sdk_extended | 85 | 6621144 | <gh_stars>10-100
"""
Copyright: MAXON Computer GmbH
Author: <NAME>
Description:
- Copies the UV seams to the edge polygon selection.
Class/method highlighted:
- c4d.modules.bodypaint.GetUVSeams()
- PolygonObject.GetEdgeS()
- BaseSelect.CopyTo()
- c4d.modules.bodypaint.UpdateMeshUV()
"""
import c4... | """
Copyright: MAXON Computer GmbH
Author: <NAME>
Description:
- Copies the UV seams to the edge polygon selection.
Class/method highlighted:
- c4d.modules.bodypaint.GetUVSeams()
- PolygonObject.GetEdgeS()
- BaseSelect.CopyTo()
- c4d.modules.bodypaint.UpdateMeshUV()
"""
import c4d
def main():
... | en | 0.697883 | Copyright: MAXON Computer GmbH Author: <NAME> Description: - Copies the UV seams to the edge polygon selection. Class/method highlighted: - c4d.modules.bodypaint.GetUVSeams() - PolygonObject.GetEdgeS() - BaseSelect.CopyTo() - c4d.modules.bodypaint.UpdateMeshUV() # Checks if selected object is vali... | 2.270016 | 2 |
lth_srl.py | trondth/master | 0 | 6621145 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import OrderedDict
from masters_project_config import *
from subprocess import Popen, PIPE, STDOUT
import re
lth_dir = DATA_PREFIX + '/lth_srl'
class Lth_srl:
def run(self, conllfile, tagged=True):
"""
@param conllfile conllfile
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import OrderedDict
from masters_project_config import *
from subprocess import Popen, PIPE, STDOUT
import re
lth_dir = DATA_PREFIX + '/lth_srl'
class Lth_srl:
def run(self, conllfile, tagged=True):
"""
@param conllfile conllfile
... | en | 0.264523 | #!/usr/bin/env python # -*- coding: utf-8 -*- @param conllfile conllfile @param tagged True if conllfile contains lemmas and pos-tags @return path to output file #testconll = "devtest.conll" | 2.258338 | 2 |
05_behavior_vis/main0b.py | cxrodgers/Rodgers2021 | 0 | 6621146 | <reponame>cxrodgers/Rodgers2021
## Plot the example frames (Fig 1B)
"""
1B, left
example_3contact_frame_with_edge_180221_KF132_242546.png
Image showing tracked whiskers in contact with concave shape
1B, right
example_3contact_frame_with_edge_180221_KF132_490102.png
Image showing tracked whiskers in ... | ## Plot the example frames (Fig 1B)
"""
1B, left
example_3contact_frame_with_edge_180221_KF132_242546.png
Image showing tracked whiskers in contact with concave shape
1B, right
example_3contact_frame_with_edge_180221_KF132_490102.png
Image showing tracked whiskers in contact with concave shape
"""
... | en | 0.803137 | ## Plot the example frames (Fig 1B) 1B, left example_3contact_frame_with_edge_180221_KF132_242546.png Image showing tracked whiskers in contact with concave shape 1B, right example_3contact_frame_with_edge_180221_KF132_490102.png Image showing tracked whiskers in contact with concave shape ## Parame... | 2.387332 | 2 |
tests/test_positionrank.py | sohyeonhwang/pytextrank | 0 | 6621147 | """Unit tests for PositionRank."""
from spacy.tokens import Doc
import sys ; sys.path.insert(0, "../pytextrank")
from pytextrank.base import BaseTextRank
from pytextrank.positionrank import PositionRank
def test_position_rank (doc: Doc):
"""It ranks keywords that appear early in the document higher than TextRank... | """Unit tests for PositionRank."""
from spacy.tokens import Doc
import sys ; sys.path.insert(0, "../pytextrank")
from pytextrank.base import BaseTextRank
from pytextrank.positionrank import PositionRank
def test_position_rank (doc: Doc):
"""It ranks keywords that appear early in the document higher than TextRank... | en | 0.904647 | Unit tests for PositionRank. It ranks keywords that appear early in the document higher than TextRank. # given # when # then # the test article mentions Chelsea at the begginning of the article # while it mentions Shanghai Shenhua annecdotally later in the article # with normal TextRank, Shanghai Shenhua is part of top... | 3.273934 | 3 |
modnet/__init__.py | modl-uclouvain/modnet | 0 | 6621148 | __version__ = "0.1.12.dev"
| __version__ = "0.1.12.dev"
| none | 1 | 1.069398 | 1 | |
nicett6/emulator/controller.py | pp81381/nicett6 | 0 | 6621149 | import asyncio
from contextlib import contextmanager, ExitStack
import logging
from nicett6.emulator.cover_emulator import TT6CoverEmulator
from nicett6.emulator.line_handler import LineHandler
from nicett6.utils import AsyncObserver
_LOGGER = logging.getLogger(__name__)
SEND_EOL = b"\r\n"
RCV_EOL = b"\r"
@contextm... | import asyncio
from contextlib import contextmanager, ExitStack
import logging
from nicett6.emulator.cover_emulator import TT6CoverEmulator
from nicett6.emulator.line_handler import LineHandler
from nicett6.utils import AsyncObserver
_LOGGER = logging.getLogger(__name__)
SEND_EOL = b"\r\n"
RCV_EOL = b"\r"
@contextm... | none | 1 | 2.498835 | 2 | |
AlgorithmTest/CODING_CHALLENGE/CC_1859.py | bluesky0960/AlgorithmTest | 0 | 6621150 | <reponame>bluesky0960/AlgorithmTest<gh_stars>0
# https://ktaivle-ai.moducoding.com/Question/1859/View/1#1
# 천하제일무술대회(중급)
import sys
from collections import deque
n = int(sys.stdin.readline())
q = deque()
for _ in range(n):
name, score = sys.stdin.readline().strip().split()
q.append((name, int(score)))
if n==1:... | # https://ktaivle-ai.moducoding.com/Question/1859/View/1#1
# 천하제일무술대회(중급)
import sys
from collections import deque
n = int(sys.stdin.readline())
q = deque()
for _ in range(n):
name, score = sys.stdin.readline().strip().split()
q.append((name, int(score)))
if n==1:
print(q.popleft()[0])
exit(0)
elif n%... | en | 0.693021 | # https://ktaivle-ai.moducoding.com/Question/1859/View/1#1 # 천하제일무술대회(중급) | 3.157304 | 3 |